{ "info": { "author": "Tarn W. Burton", "author_email": "", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Programming Language :: Python :: 3.7" ], "description": "# Metys\n\nMetys is scientific report generator and a literate programming tool similar to\nknitr or Pweave. Like Pweave, Metys uses the Jupyter protocol to run code\nembedded in the source document. Unlike Pweave, Metys can access multiple\nJupyter kernels within the same source document and can also create multiple\nseparate sessions of the same kernel.\n\nMetys is currently alpha level software.\n\n## Processing Metys Documents\n\nMetys is currently run from the command line by using the following.\n\n```sh\nmetys foo.tmt\n```\n\nThere are many command line options available. A short description will be shown\nwith the following.\n\n```sh\nmetys --help\n```\n\n## Input Formats\n\nMetys can parse source documents in noweb, Markdown or Metys format. The format\nof the source document will be determined by the file extension or by the\n`--parser` command line option if specified. Source documents with a file\nextension ending with `nw` are assumed to be noweb documents. Those with a file\nextension ending with `md` are assumed to be Markdown documents. All other files\nare assumed to be in Metys format.\n\nParsing the source document results in a series of logical chunks. These chunks\nare either text, code or group chunks. Text chunks contain text which is copied\nverbatim to the output document. Code chunks are evaluated by a Jupyter kernel\nand the results are formatted in the output document as per the local and global\noptions specified. Group chunks are used to set options for a collection of\nchunks or to include subfiles which contain more text, code and group chunks.\n\n### noweb Format\n\nA document in the noweb format can contain text or code chunks, but not group\nchunks. Text chunks are preceded by a line containing only an `@`. Code chunks\nare preceded by a line containing `<<...>>=`, where `...` represents a list of\nkey/value options. Both text and code chunks are terminated by a marker starting\na new chunk. The first chunk in a noweb document is assumed to be a text chunk.\n\nIn the sample document below a Maxima kernel is asked to solve a cubic equation,\nsome code is sent to Python and then Maxima is asked to plot a function. Please\nnote that key value options that are missing a value are assumed to a chunk name.\nIn other words `<>=` is equivalent to\n`<>=`.\n\n```\nLet's ask Maxima to solve a cubic equation.\n<>=\nsolve(x^3+x+1=0,x);\n@\nNext let Python say hello and have Maxima plot a hyperbolic paraboloid.\n<>=\nprint('Hello world!')\n<>=\nplot3d (u^2 - v^2, [u, -2, 2], [v, -3, 3], [grid, 100, 100],\n [mesh_lines_color, false], [svg_plot, \"m.svg\"]);\n@\nThat's all for now.\n```\n\n### Markdown Format\n\nSource documents in the Markdown format can contain text or code chunks, but not\ngroup chunks. Code chunks are delimited by a pair of single back-ticks or by a\npair of triple back-ticks. This is the same delimiters that plain Markdown uses\nto indicate code, the difference being that Metys expects a set of key/value\noptions surrounded by curly braces or a set of empty curly braces.\n\nThe following sample document accomplishes the same tasks as the previous noweb\nexample. Unlike noweb document key value options without a value are assumed\nto be a kernel name, not a chunk name.\n\n````Markdown\nLet's ask Maxima to solve a cubic equation.\n\n```{maxima}\nsolve(x^3+x+1=0,x);\n```\n\nNext let Python say hello and have Maxima plot a hyperbolic paraboloid.\n`{python} print('Hello world!')`\n\n```{maxima, name=foo}\nplot3d (u^2 - v^2, [u, -2, 2], [v, -3, 3], [grid, 100, 100],\n [mesh_lines_color, false], [svg_plot, \"m.svg\"]);\n```\nThat's all for now.\n````\n\n### Metys Format\n\nDocuments in Metys format can contain text, code or group chunks. Like Markdown\nthe entire document is assumed to be in text mode, so only code and group chunks\nhave delimiters. Both code and group chunks are started by `<|` and terminated\nby `|>`. After the opening delimiter key/value options may be specified until a\nchunk separator is received. The remainder of the chunk is then either code or\ngroup data. The chunk separators are `:`, `|` or `@`. The `:` separator is used\nfor code blocks, the `|` separator is used for inline code, and the `@`\nseparator is used for group chunks. For example, the following using a group to\ndeclare Maxima as the default kernel before making calls to a Maxima kernel and\na Python kernel.\n\n```\n<|maxima@\nLet's ask Maxima to solve a cubic equation.\n\n<|:solve(x^3+x+1=0,x);|>\n\nNext let Python say hello and have Maxima plot a hyperbolic paraboloid.\n<|python|print('Hello world!')|>\n\n<|name=foo:\nplot3d (u^2 - v^2, [u, -2, 2], [v, -3, 3], [grid, 100, 100],\n [mesh_lines_color, false], [svg_plot, \"m.svg\"]);\n|>\nThat's all for now.\n|>\n```\n\nPlease note that kernels and sessions are local to the innermost enclosing\ngroup chunk.\n\n## Chunk Options\n\nChunk options may be specified in all input formats as a list of key/value pairs\nseparated by commas. Each key/value pair consists of a name followed by an\nequals sign and a value. The absence of an equals sign and a value is treated as\na value to be assigned to a default key. The default key for noweb format is\n`name`. For all other formats the default key is `kernel`.\n\nThe key name may contain any combination of letters and underscores, along with\na single period used to specify sub-options. For example, the following\nspecifies a Maxima kernel, with a LaTeX code environment of `Verbatim` and\n`frame=single` as a verbatim environment option.\n\n```\n<|maxima, code_env=Verbatim, code_env_options.frame=single:\nsolve(x^3+x+1=0,x);\n|>\n```\n\nThe table below lists the chunk options available along with a short summary of\neach option.\n\n| Name | Type | Default | Description |\n|:-------------------|:-----------------------------|:-----------|:-----------------------------------------------|\n| code_echo | boolean | `true` | Enable echo of code input. |\n| code_env | string | `verbatim` | Code environment for LaTeX. |\n| code_env_options | string/sub-option | None | Code environment options for LaTeX. |\n| evaluate | boolean | `true` | Enable evaluation of code input. |\n| expand_options | boolean | `false` | Enable option expansion in code input. |\n| figure_caption | string | None | Figure caption. |\n| figure_env | string | `figure` | Figure environment for LaTeX. |\n| figure_path | string | `figure` | Figure directory. |\n| figure_env_options | string/sub-option | None | Figure environment options for LaTeX. |\n| figure_prefix | string | `fig:` | Figure label prefix for LaTeX. |\n| format | `latex`, `markdown` | None | Format of output file. |\n| graphics_options | string/sub-option | None | Graphics options for LaTeX. |\n| inline | boolean | None | Enable inline output format. |\n| input | string | None | Path of input file for chunk. |\n| kernel | string | None | Jupyter kernel. |\n| math_env | string | `equation` | Display math environment for LaTeX. |\n| math_prefix | string | `eq:` | Mathematics label prefix for LaTeX. |\n| name | string | None | Chunk name. Used for file names and labels. |\n| output | string | None | Path of output file for chunk. |\n| parser | `markdown`, `metys`, `noweb` | None | Parser to use for input file. |\n| results | boolean | `true` | Enable output of code results. |\n| session | string | None | Unique identifier for specific kernel session. |\n| stderr_echo | boolean | `true` | Enable echo of stderr. |\n| stderr_env | string | `verbatim` | stderr environment for LaTeX. |\n| stderr_env_options | string/sub-option | None | stderr environment options for LaTeX. |\n| stdout_echo | boolean | `false` | Enable echo of stdout. |\n| stdout_env | string | `verbatim` | stdout environment for LaTeX. |\n| stdout_env_options | string/sub-option | None | stdout environment options for LaTeX. |\n| wrap_math | boolean | `true` | Enabling wrapping of math results. |\n\nPlease not that some options are automatically deduced or may have special\nbehavior. For instance,\n\n- The `format` option is automatically set if not specified. If `parser` is\n set to `markdown` then the `format` is also. Otherwise `format` is set to\n `latex`.\n\n- The `inline` option is automatically set for Markdown and Metys documents, but\n not for noweb documents.\n\n- The `input` option has a different behavior for text/code chunks versus group\n chunks. For group chunks the chunks contents are replaced with the contents\n of the file specified by `input` after it has been parsed. For text or code\n chunks the contents of the file is included without any parsing.\n\n- The `kernel` option is not set by default but will be set to `python` for\n input files with an extension of `.Pmd` and set to `r` for input files with an\n extension of `.Rmd`.\n\n- The `output` option will write any chunk output to the file specified by the\n option versus writing the output to main output document.\n\n- The `session` option will allow multiple separate sessions of the same kernel\n to exist. For example, the following document will have two separate Python\n kernels active. In the default session `x` has a value of 3, while in the\n `foo` session `x` has a value of 4.\n\n ```\n Wibble <|python|x=3|>, wibble <|python,session=foo|x=4|>, quux <|python|x|>.\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": "", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "metys", "package_url": "https://pypi.org/project/metys/", "platform": "", "project_url": "https://pypi.org/project/metys/", "project_urls": null, "release_url": "https://pypi.org/project/metys/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Multi-kernel/Multi-session Jupyter scientific report generator and literate programming tool.", "version": "0.1.2" }, "last_serial": 4457314, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b971a19f6617564a9aba465d46941217", "sha256": "a4a6ffa7979053d7f38bc0fd2905990695a1f22d97b1a4110a3fa64739df6047" }, "downloads": -1, "filename": "metys-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b971a19f6617564a9aba465d46941217", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15670, "upload_time": "2018-11-05T20:46:27", "url": "https://files.pythonhosted.org/packages/40/2e/15334824c75cc3b5213d498f1b1989839f7a3fa632c10b87c726fdd6fcd0/metys-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9004839e9bd11e1d6fd3b8eee4b52299", "sha256": "124790ebae34821fe0f62666df72b73cebee58cc6599701d99bcbcb09e15497d" }, "downloads": -1, "filename": "metys-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9004839e9bd11e1d6fd3b8eee4b52299", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14488, "upload_time": "2018-11-05T20:46:29", "url": "https://files.pythonhosted.org/packages/6d/ee/6e33fe6852793ce999b9e7f476bbe056e59ff8b8997eca75690fd8b77c81/metys-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f70971eaaf27ee8612b919586e8cb6ce", "sha256": "6269e141d1d3bc652f9778847e360e52086544ee0e53045a8be03be73c920b7d" }, "downloads": -1, "filename": "metys-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f70971eaaf27ee8612b919586e8cb6ce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15683, "upload_time": "2018-11-05T20:49:52", "url": "https://files.pythonhosted.org/packages/26/61/7b0f9215f31851f54fe6046d95ab532706afad08e76501b1385ef5ff5cfd/metys-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd50656b3dfaa053d8c7408c144ee57f", "sha256": "c5183b60bffccf438124d9dec7e6ee8e58566302a194185eec7399cc07c9ea11" }, "downloads": -1, "filename": "metys-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bd50656b3dfaa053d8c7408c144ee57f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14516, "upload_time": "2018-11-05T20:49:53", "url": "https://files.pythonhosted.org/packages/a6/e1/333f186b4c1f1057d2a0be6881a58c0ce18535872c7547203f58e37be680/metys-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "dfa2fc513fe16150bae2ca3715804d6e", "sha256": "62c6add5d5dbfc3c2853254379ccd5b948a37c26f246775ffb649493083ebe4e" }, "downloads": -1, "filename": "metys-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "dfa2fc513fe16150bae2ca3715804d6e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15722, "upload_time": "2018-11-06T13:12:42", "url": "https://files.pythonhosted.org/packages/e5/eb/31c586c33a4dbe32d12afcda5cf66928fdcc48872ef455ca2c53ec708b74/metys-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fc2a3bf1284b0c4abcbf3bf1c796f522", "sha256": "c1790abe56b61321c5e3db4000226a15ebfc26e4d96e29b85ee3360d1eb7fa4a" }, "downloads": -1, "filename": "metys-0.1.2.tar.gz", "has_sig": false, "md5_digest": "fc2a3bf1284b0c4abcbf3bf1c796f522", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14546, "upload_time": "2018-11-06T13:12:43", "url": "https://files.pythonhosted.org/packages/5d/ce/b76c04553e776fc24923b1343eff823ad199e8d72ecec8614ea58e0cdbaf/metys-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dfa2fc513fe16150bae2ca3715804d6e", "sha256": "62c6add5d5dbfc3c2853254379ccd5b948a37c26f246775ffb649493083ebe4e" }, "downloads": -1, "filename": "metys-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "dfa2fc513fe16150bae2ca3715804d6e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15722, "upload_time": "2018-11-06T13:12:42", "url": "https://files.pythonhosted.org/packages/e5/eb/31c586c33a4dbe32d12afcda5cf66928fdcc48872ef455ca2c53ec708b74/metys-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fc2a3bf1284b0c4abcbf3bf1c796f522", "sha256": "c1790abe56b61321c5e3db4000226a15ebfc26e4d96e29b85ee3360d1eb7fa4a" }, "downloads": -1, "filename": "metys-0.1.2.tar.gz", "has_sig": false, "md5_digest": "fc2a3bf1284b0c4abcbf3bf1c796f522", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14546, "upload_time": "2018-11-06T13:12:43", "url": "https://files.pythonhosted.org/packages/5d/ce/b76c04553e776fc24923b1343eff823ad199e8d72ecec8614ea58e0cdbaf/metys-0.1.2.tar.gz" } ] }