{ "info": { "author": "Kikocorreoso", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Text Processing :: Markup :: HTML" ], "description": "Brythonmagic\n============\n\nBrython magic for the Jupyter notebook.\n\nThe brythonmagic provides you a cell magic, ``%%brython``, to run\nbrython code and show the results in a html ``div`` tag below the code\ncell. Best way to start with Brython is to check `the Brython docs in\ntheir home page `__.\n\nTested on\n---------\n\nThe brythonmagic extension has been tested on:\n\n- Jupyter versions >= (4, 0, 0, '')\n\n- Python version >= 3.3 and == 2.7\n\n- Brython versions >= (2,0,0) \n\nInstallation\n------------\n\nYou should have Jupyter (notebook) already installed in order to use\nBrythonmagic. In case you don't have Jupyter installed you can follow\nthe instructions on the `Jupyter official\npage `__.\n\nTo install brythonmagic itself just type the following:\n\n.. code:: python\n\n pip install brythonmagic\n\nor download this repo and on the brythonmagic downloaded folder type:\n\n.. code:: python\n\n python setup.py install\n\nThen, load the extension:\n\n.. code:: python\n\n %load_ext brythonmagic\n\nAnd, finally, load the stable brython js lib in the notebook using the \nfollowing code:\n\n.. code:: python\n\n from brythonmagic import load_brython_stable\n load_brython_stable()\n\nIn case you want to use the development brython js lib in the notebook \nuse the following code:\n\n.. code:: python\n\n from brythonmagic import load_brython_dev\n load_brython_dev()\n\nIf you have any problem with the installation, please, open an\n`issue `__.\n\nWARNING\n-------\n\nIn order to load javascript libraries in a safety way you should try to\nuse https instead of http when possible (read more\n`here `__).\nIf you don't trust the source and/or the source cannot be loaded using\nhttps then you could download the javascript library and load it from a\nlocal location.\n\nBrythonmagic doesn't load any javascript library and the user should\ntake care about the security and should use trusted sources.\n\nYou can load third party javascript libraries using the following code:\n\n.. code:: python\n\n from brythonmagic import load_js_lib\n load_js_lib(\"https://url/to/your/lib.js\")\n\nUsage\n-----\n\nexample:\n\n.. code:: python\n\n %%brython -c zone\n # First of all, the import of some libraries\n from browser import document, html\n\n # All the elements will be inserted in the div with the \"zone\" id\n zone = document['zone']\n\n # We create a new div element\n newdiv = html.DIV(Id = \"new-div\")\n # Now we add some style\n newdiv.style = {\"padding\": \"5px\", \n \"backgroundColor\": \"#ADD8E6\"}\n\n # We create a new link and add the link to a string\n blink = html.A('brython',href=\"http://brython.info\")\n text = \"Brython is really cool, look at \"+ blink + \" for more\"\n\n # Now we add the text to the div with id=\"new-div\"\n newdiv <= html.DIV(text)\n\n # Finally, we add the newdiv to the outer div with id=\"zone\"\n zone <= newdiv\n\nYou can use several options:\n\n- -p, --print: will show you the generated html code below the results\n obtained from the brython code.\n\n- -c, --container: you can define the name of the ``div`` container in\n case you want to 'play' with it in other cell. If you don't define an\n output the ``div`` will have an ``id`` with the following format\n 'brython-container-[random number between 0 and 999999]'. Just one\n container name is accepted. If you pass more than one only the first\n one will be used and a warning will raise.\n\n- -i, --input: you can pass variables defined in the Python namespace\n separated by whitespaces. If you pass a python list it will be\n converted to a brython list, a python tuple will be converted to a\n brython tuple, a python dict will be converted to a brython dict, a\n python string will be converted to a brython string.\n\n- -h, --html: you can pass a string with html markup code. This html\n code will be inserted inside the div container. In this way you can\n avoid the generation of HTML markup code via a Brython script so you\n can separate the layout from the 'action'. Just one html markup code\n string name is accepted. If you pass more than one only the first one\n will be used and a warning will raise.\n\n- -s, --script: Use this option to provide an id to the script defined\n in the Brython code cell. Also, this value could be used to run the\n code of this cell in other brython cells. Just one script name is\n accepted. If you pass more than one only the first one will be used\n and a warning will raise.\n\n- -S, --scripts: Use this option to run code previously defined in\n other Brython code cells. The values should be the provided values in\n the -s/--script option in other Brython code cells.\n\n- -f, --fiddle: With this option, the code in the cell will be\n automatically uploaded to\n `gist.github.com/ `__ as an anonymous gist\n with several files in it. This files will be used to create an\n anonymous 'fiddle' on `jsfiddle.net `__.\n Finally, some links will be printed in the output linking to the gist\n and the fiddle. See an example here\n (https://gist.github.com/anonymous/b664e8b4617afc09db6c and\n http://jsfiddle.net/gh/gist/library/pure/b664e8b4617afc09db6c/)\n\n- -e, --embedfiddle: With this option, the code in the cell will be\n automatically uploaded to\n `gist.github.com/ `__ as an anonymous gist\n with several files in it. This files will be used to create an\n anonymous 'fiddle' on `jsfiddle.net `__.\n Finally, some links will be printed in the output linking to the gist\n and the fiddle and an iframe will be created showing the fiddle on\n `jsfiddle.net `__.\n\n`WARNING <#warning>`__ This options may change as the brythonmagic\ndepending the development of Brython and/or Jupyter.\n\nTo see some examples download the notebooks available in the repository\nand run it locally or see it in the\n`nbviewer `__\n(you will lose the interactivity if you choose the second option).\nAlso, you can take a look on the following video:\nhttp://youtu.be/adQzjuUX0kw\n\nExample notebooks\n-----------------\n\n- `General usage of\n Brythonmagic `__.\n\n- `An Openlayers\n tutorial `__.\n\n- `A Highcharts\n tutorial `__\n\nSupport\n-------\n\nIf you need Brython support, please, ask here:\nhttps://groups.google.com/forum/?fromgroups=#!forum/brython\n\nIf you need Jupyter support, please, ask here:\nhttp://mail.scipy.org/mailman/listinfo/ipython-dev\n\nIf you find a bug or want to propose a new feature open a new issue\nhere: https://github.com/kikocorreoso/brythonmagic/issues\n\nIf you want to improve the code, fork, commit and send a PR ;\u00b7D", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kikocorreoso/brythonmagic", "keywords": "brython ipython jupyter notebook javascript", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "brythonmagic", "package_url": "https://pypi.org/project/brythonmagic/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/brythonmagic/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kikocorreoso/brythonmagic" }, "release_url": "https://pypi.org/project/brythonmagic/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Magics to use brython in Jupyter notebook.", "version": "0.2.1" }, "last_serial": 2079697, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "305655b341becc9fdfe3c92b529a0344", "sha256": "8776af5c22cefd1335eeb8795c56f736a6165929a81db256bc7fe4288c27ff38" }, "downloads": -1, "filename": "brythonmagic-0.1.tar.gz", "has_sig": false, "md5_digest": "305655b341becc9fdfe3c92b529a0344", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8201, "upload_time": "2014-12-09T16:29:50", "url": "https://files.pythonhosted.org/packages/3c/58/149882f6750c5583f50779058f39b4ecc6bd04b9e3eabe0b97b4ac54d222/brythonmagic-0.1.tar.gz" } ], "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a85d37a11b08357e96ae54bc4be7febb", "sha256": "f75e35db7685cba7e2e5090a6eda93686437e575bff55379e482b078a3b21cc4" }, "downloads": -1, "filename": "brythonmagic-0.1.1.tar.gz", "has_sig": false, "md5_digest": "a85d37a11b08357e96ae54bc4be7febb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7869, "upload_time": "2015-03-25T19:41:54", "url": "https://files.pythonhosted.org/packages/b4/32/296cbdd5c230c7a68179ebbff3d8b0ad295e22e5bf4cd80ac4951428994d/brythonmagic-0.1.1.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "5404951b2eae390b17fba245af38dd4e", "sha256": "1042477e4df57fb0c32501bb17f55fe79a53efed7e0c4ecac6b772f60008a55b" }, "downloads": -1, "filename": "brythonmagic-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5404951b2eae390b17fba245af38dd4e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11573, "upload_time": "2016-04-23T07:06:42", "url": "https://files.pythonhosted.org/packages/22/6b/6bbd31e03506e032fb9656fca0b30b25de798158a6746b9e27523b35b0f0/brythonmagic-0.2.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5404951b2eae390b17fba245af38dd4e", "sha256": "1042477e4df57fb0c32501bb17f55fe79a53efed7e0c4ecac6b772f60008a55b" }, "downloads": -1, "filename": "brythonmagic-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5404951b2eae390b17fba245af38dd4e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11573, "upload_time": "2016-04-23T07:06:42", "url": "https://files.pythonhosted.org/packages/22/6b/6bbd31e03506e032fb9656fca0b30b25de798158a6746b9e27523b35b0f0/brythonmagic-0.2.1-py3-none-any.whl" } ] }