{ "info": { "author": "deathbeds", "author_email": "tony.fast@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: IPython", "Framework :: Jupyter", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3.6" ], "description": "\n`pidgin` is a collection of IPython magics for creating computable essays.\n\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/deathbeds/pidgin/master?filepath=readme.ipynb)\n\n\n```python\n if __name__ == '__main__': \n %load_ext pidgin\n```\n\n# Markdown Mode\n\n\n```python\n %pidgin markdown \n```\n\n\n```python\n---\nWith `pidgin.markdown`, code cells accept markdown. Any indented code blocks are executed.\n\n foo = 42\n print(f\"foo is {foo}\")\n\n> Accepting the `pidgin.markdown` convetion means the author agrees to indent all their code at least once; and sometimes more in nested lists. \n\n---\n```\n\n\n---\nWith `pidgin.markdown`, code cells accept markdown. Any indented code blocks are executed.\n\n foo = 42\n print(f\"foo is {foo}\")\n\n> Accepting the `pidgin.markdown` convetion means the author agrees to indent all their code at least once; and sometimes more in nested lists. \n\n---\n\n\n foo is 42\n\n\n# Template Mode\n\nWith templates real data can be inserted into the computational essay. An author should desire their notebook restart and run all during template mode.\n\n\n```python\n\n %pidgin template\nSkipping the first line suppresses the markdown output.\n```\n\n\n```python\n---\nIn template mode, `jinja2` may be invoked to template markdown and code. We already know that `foo` is 42, but can test that assertion with\n\n assert foo is {{foo}} is 42\n {% for i in range(3) %}print({{i}})\n {% endfor %}\n---\n```\n\n\n---\nIn template mode, `jinja2` may be invoked to template markdown and code. We already know that `foo` is 42, but can test that assertion with\n\n assert foo is 42 is 42\n print(0)\n print(1)\n print(2)\n\n---\n\n\n 0\n 1\n 2\n\n\n\n```python\n# Turning off magics\n\n %pidgin --off template markdown\n```\n\n\n# Turning off magics\n\n %pidgin --off template markdown\n\n\n## Yaml\n\nStart code with `---`\n\n\n```python\n %pidgin conventions\n```\n\n\n```python\n ---\n a: 42\n```\n\n\n```python\n assert a == 42\n```\n\n## Graphviz\n\nStart code with `graph` or `digraph`\n\n !conda install -y graphviz\n\n\n```python\n graph { {Ipython Julia R}--Jupyter}\n```\n\n\n File \"\", line 1\n graph { {Ipython Julia R}--Jupyter}\n ^\n SyntaxError: invalid syntax\n\n\n\n# Notebooks as source\n\npidgin uses notebooks as source; line numbers are retained so that the notebook source produces semi-sane tracebacks.\n\n\n```python\n from pidgin import markdown, template, conventions\n```\n\nThe pidgin loader allows an author to import notebooks directly as source. This means all of the pidgin documents are importable.\n\n\n```python\n %%pidgin markdown template conventions\n import readme\n```\n\n\n```python\n assert all(file.__file__.endswith('.ipynb') for file in (markdown, template, conventions))\n```\n\n#### Everything Should Compute\n\nConvert a document into other formats; Restart, Run All, `nbconvert`.\n\n\n```python\n%%pidgin markdown template\nUse pidgin a cell magic to temporarily employ any convetions.\n\n if __name__ == '__main__':\n !jupyter nbconvert --to markdown readme.ipynb\n```\n\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/deathbeds/pidgin", "keywords": "", "license": "BSD-3-Clause", "maintainer": "", "maintainer_email": "", "name": "pidgin", "package_url": "https://pypi.org/project/pidgin/", "platform": "", "project_url": "https://pypi.org/project/pidgin/", "project_urls": { "Homepage": "https://github.com/deathbeds/pidgin" }, "release_url": "https://pypi.org/project/pidgin/0.0.1/", "requires_dist": [ "dataclasses", "CommonMark", "pyyaml", "ipython", "nbconvert", "hypothesis", "graphviz", "importnb" ], "requires_python": ">=3.6", "summary": "Conventions for writing code in the notebook.", "version": "0.0.1" }, "last_serial": 3857807, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c03fee31b823ae8b82652e9f6d275dfb", "sha256": "fcd84acaca8e13f8489d0c66b25868c144f4c102b60fb995fd20d542013b3a74" }, "downloads": -1, "filename": "pidgin-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c03fee31b823ae8b82652e9f6d275dfb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 17800, "upload_time": "2018-05-13T02:58:12", "url": "https://files.pythonhosted.org/packages/74/19/ee91d430425c3fba62dbcba0cb7e9d37f61c3075e19313cb27bf7adc67f3/pidgin-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d7b8b21111c15bdc49128a43bc59c3c4", "sha256": "7da890dfc843d41c76542063c551ab81d4de9ba8af44d7d917efb7612721a3a5" }, "downloads": -1, "filename": "pidgin-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d7b8b21111c15bdc49128a43bc59c3c4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10548, "upload_time": "2018-05-13T02:58:13", "url": "https://files.pythonhosted.org/packages/1b/95/c6ac236ce3d9e3a3f174db1c161b4c7acab53baad7c2aaf129b4fe8d7b81/pidgin-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c03fee31b823ae8b82652e9f6d275dfb", "sha256": "fcd84acaca8e13f8489d0c66b25868c144f4c102b60fb995fd20d542013b3a74" }, "downloads": -1, "filename": "pidgin-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c03fee31b823ae8b82652e9f6d275dfb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 17800, "upload_time": "2018-05-13T02:58:12", "url": "https://files.pythonhosted.org/packages/74/19/ee91d430425c3fba62dbcba0cb7e9d37f61c3075e19313cb27bf7adc67f3/pidgin-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d7b8b21111c15bdc49128a43bc59c3c4", "sha256": "7da890dfc843d41c76542063c551ab81d4de9ba8af44d7d917efb7612721a3a5" }, "downloads": -1, "filename": "pidgin-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d7b8b21111c15bdc49128a43bc59c3c4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10548, "upload_time": "2018-05-13T02:58:13", "url": "https://files.pythonhosted.org/packages/1b/95/c6ac236ce3d9e3a3f174db1c161b4c7acab53baad7c2aaf129b4fe8d7b81/pidgin-0.0.1.tar.gz" } ] }