{ "info": { "author": "Kent Watsen", "author_email": "kent@watsen.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "License :: OSI Approved :: ISC License (ISCL)", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# xiax: eXtract or Insert artwork And sourcecode to/from Xml\n\nFree software provided by Kent Watsen (Watsen Networks)\n\n\n## Purpose\n\nTo aid in the construction (and deconstruction) of submittable `xml2rfc`\nv2 [RFC 7749] and v3 [RFC 7991] documents.\n\n * For authors : automates common steps.\n * For reviewers : ensures correctness and facilitates validations.\n * For copyeditors : provides safety net for making changes.\n\n```\n +----------+ +----------+ pack +---------+\n | | prime | | ------------> | |\n | source | -----------> | primed | | ready |\n | | | | <------------ | |\n +----------+ +----------+ unpack +---------+\n | ^\n | |\n +------+\n validate\n```\n\n## Installation\n\n `pip install xiax`\n\n * Developed on Python 3.7\n * Tested on Python 3.6, 3.5, 3.4, and 2.7.\n\n## Usage\n\n```\nusage: xiax [-h] [-v] [-d] [-f] source [destination]\n\neXtract or Insert artwork And sourcecode to/from Xml\n\npositional arguments:\n source source XML document to extract from or insert into.\n destination destination file or directory. If unspecified, then\n the current working directory is assumed.\n\noptional arguments:\n -h, --help show this help message and exit\n -v, --version show version number and exit.\n -d, --debug print verbose output to stdout.\n -f, --force allow existing files to be overwritten.\n\nExit status code: 0 on success, non-0 on error. \nDebug output goes to stdout. Error output goes to stderr.\n\n```\n\n\n## Auto-sensing Mode:\n\nThe \"source\" XML file is scanned for an XML comment beginning with the\nstring \"##xiax-block-v1:\". If this string is found, then extraction\nproceeds, else insertion proceeds.\n\nReferring to the diagram above:\n\n - \"insertion\" refers to both priming and packing.\n - \"extraction\" refers only to unpacking.\n\n\n## Insertion:\n\nInsert local file content from `` and `` elements\ninto \"source\", saving the resulting \"packed\" XML file into as described\nbelow.\n\nThe \"source\" parameter must refer to an XML file containing the ``\nelement. \n\nIf the \"destination\" parameter ends with \".xml\", the argument is used \nto determined both the destination directory, as well as the draft's \nrevision number. For instance, \"./foo-03.xml\" would set the current\nworking directory to be the destination directory, and \"03\" as the\nrevision number to be used.\n\nIf the \"destination\" parameter is present, but does not end with \".xml\",\nthen the argument is used only to determined the destination directory.\nThe system will try to determine the draft revision number as the next\nlogical `git tag` (see [Git Tagging] below) and, if that doesn't work,\nwill assume \"-00\". The determined revision number is placed into the\n\"source\" filename, either by replacing \"latest\" with it (if found), or\nby appending it (e.g., both \"foo.xml\" and \"foo-latest.xml\" might result\nin foo-00.xml).\n\nIf the \"destination\" parameter is not provided, then the current working\ndirectory is used (same as if \"./\" had been passed).\n\nIn the source XML file, the `` element `docName` attribute may\ninclude the suffix \"-latest\", which will be replaced with the determined\nrevision number. This is recommended. The `` element should also\ndefined the \"xiax\" prefix (e.g., `xmlns:xiax=\"https://watsen.net/xiax\"`).\n\nIn the source XML file, only `` and `` elements\nhaving a `xiax:src` (for \"source') or `xiax:gen` (for \"generate\")\nattribute are processed (it is an error if both attributes appear for\nthe same element). Both attributes take a URI, but the URI must specify\na local file under the draft document's directory.\n\nValid \"xiax:src\" attribute examples:\n - xiax:src=\"ietf-foobar@YYYY-MM-DD.yang\"\n - xiax:src=\"images/ex-ascii-art.txt\"\n - xiax:src=\"file:ietf-foobar@YYYY-MM-DD.yang\"\n - xiax:src=\"file:images/ex-ascii-art.txt\"\n \nInvalid \"src\" attribute examples:\n - xiax:src=\"/ex-ascii-art.txt\"\n - xiax:src=\"c:/ex-ascii-art.txt\"\n - xiax:src=\"a/../../ex-ascii-art.txt\"\n - xiax:src=\"file:///ex-ascii-art.txt\"\n - xiax:src=\"file://c/ex-ascii-art.txt\"\n - xiax:src=\"file:a/../../ex-ascii-art.txt\"\n\nNotes:\n * The `xiax:gen` and `xiax:val` attributes have the same pattern.\n * Any strings containing \"YYYY-MM-DD\" (either in the \"source\" \n XML file, or in the linked filename or content) will be updated\n to have the value of the current.\n\nIt is an error if there is preexisting content for the `` or \n`` element. A solution for inserting \"fallback\" content\nwhile preserving an `xml2rfc` \"src\" attribute to binary (i.e., SVG)\ncontent has yet to be defined.\n\nIn addition to the `xiax:src` and `xiax:gen` attributes, an optional\n`xiax:val` (for \"validate\") attribute may be specified, to define\nparameters for validating the `` and `` element's\ncontent. Additionally, a `xiax:markers` attribute may be specified\nto wrap the content with the `` and `` tags\ndescribed in RFC 8407 Section 3.2.\n\nAdditionally, `xiax` will automatically fold any content containing\na line exceeding 69 characters, using the algortihm defined in\ndraft-ietf-netmod-artwork-folding. (Note: this logic isn't\nimplemented yet).\n\nThe result of the insertion process is the creation of the determined\ndestination XML file in which all `xiax:` prefixed attrbutes in the\n``, ``, and `` elements have been removed,\nand an XML comment beginning with the string \"##xiax-block-v1:\" is\nadded to the end of the XML file.\n \nIt is an error for the destination file to already exist, unless the\n\"force\" flag is specified, in which case the destination file will be\noverwritten. \n\nThe source XML file is never modified.\n\n\n## Extraction:\n\nExtract the content of `` and `` elements, having\nan entry in the \"xiax-block\" comment into the specified extraction\ndirectory. \n\nIf the \"destination\" parameter ends with \".xml\", the argument is used \nto determined both the extraction directory, as well as the unpacked\ndraft name. Note: the \"unpacked\" (or \"primed\") XML file is extracted\nonly when the destination parameter ends with \".xml\".\n\nIf the \"destination\" parameter is present, but does not end with \".xml\",\nthen the argument is used only to determined the extraction directory\n(the unpacked draft XML file will not be saved).\n\nIf the \"destination\" parameter is not provided, then the current working\ndirectory is used as the extraction directory. This is the same as if\n\"./\" were passed.\n\nOnly `` and `` elements having entries in the\n\"xiax-block\" are extracted. The extracted files are relative to the \nextraction directory. Subdirectories will be created as needed.\n\nIn addition to the element's content being extracted, all the additional\nfiles used to generate and validate the content are also extracted.\nThis not only includes the files referenced by the `xiax:gen` and\n`xiax:val` attributes, but also any additional local files files\nreferenced by those files.\n\nIt is an error if any file already exists, unless the \"force\" flag is\nspecified, in which case the file will be overwritten. \n\nIt is planned to implement the ability to automatically validate the\n`xiax:src` and `xiax:gen` content, but this is somewhat dependent on\ninput from users, as it may be sufficient the know that the validations\nran authomatically during \"insertion\" and that they may be manually\nrun after the extraction.\n\nThe source XML file is never modified.\n\n\n## Round-tripping\n\nIt is possible to run `xiax` in a loop:\n\n```\n # xiax -f -s packed-00.xml -d unpacked-00.xml\n # xiax -f -s unpacked-00.xml -d packed-00.xml\n```\n\n\n## Git Tagging\n\nGit tags should (assuming `git` is being used as the SCM) be used to \ntag milestones. In the context of authoring documents, the milestones \nare the published versions of the draft in progress.\n\nBy example, assuming that draft--03 has already been published, \nwhich implies that 02, 01, and 00 were published before as well, than \n`get tag` should produce the following result in the working directory:\n\n```\n# git tag\ndraft--00\ndraft--01\ndraft--02\ndraft--03\n```\n\n\n## Special Support\n\nTypically the \"source\" parameter specifies an `xml2rfc` XML file but, in\norder to support the development of the \"generate\" and \"validate\" files,\nthese XML files MAY be passed as the \"source\" parameter instead, in which\ncase `xiax` just processes the single file.\n\nIf the \"source\" parameter specifies a \"generate\" file, the \"destination\"\nparameter, if passed, will be ignored, as the generated content is sent\nto STDOUT.\n\nIf the \"source\" parameter specifies a \"validate\" file, the \"destination\"\nparameter must specify the relative path to the file to be validated.\n\nRunning `xiax` this way must occur from the draft document's top-level\ndirectory (the current working directory is the document's directory).", "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/kwatsen/xiax", "keywords": "ietf,rfc,artwork,sourcecode,extraction,insertion,folding,unfolding", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "xiax", "package_url": "https://pypi.org/project/xiax/", "platform": "", "project_url": "https://pypi.org/project/xiax/", "project_urls": { "Homepage": "https://github.com/kwatsen/xiax" }, "release_url": "https://pypi.org/project/xiax/0.6.0/", "requires_dist": null, "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "summary": "Extract or insert artwork/sourcecode from/to an `xml2rfc` XML document.", "version": "0.6.0" }, "last_serial": 4866125, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "ff05f7a8b11aa700812fafa7035c6aea", "sha256": "16040e9a67e1c9faa8eb23733d94b818251ef7184167d2f6e97d44be200761e7" }, "downloads": -1, "filename": "xiax-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ff05f7a8b11aa700812fafa7035c6aea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 4311, "upload_time": "2019-01-31T05:13:45", "url": "https://files.pythonhosted.org/packages/ad/07/070998172677a9225414789e797c1bb61699815faa91dd873a5850d031b5/xiax-0.0.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "7a802e2da2658391f448984c7cf7f480", "sha256": "8ce2409a933422cb02e101c0ce58ff313331189d8406c5efa3d6f5299fab2310" }, "downloads": -1, "filename": "xiax-0.5.3.tar.gz", "has_sig": false, "md5_digest": "7a802e2da2658391f448984c7cf7f480", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 16494, "upload_time": "2019-02-14T23:03:23", "url": "https://files.pythonhosted.org/packages/57/77/b9bf2171a1592e56bc53027b2cb7cf4ab50ca38f9b5a918dd24bcd8b0b27/xiax-0.5.3.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "7bbb78d08dc1a2d1b3da687c29d7ffeb", "sha256": "4be7d8895d484167e1d86c03cda7e307d14140eeb85ecdaf7434a4553773cfc8" }, "downloads": -1, "filename": "xiax-0.6.0.tar.gz", "has_sig": false, "md5_digest": "7bbb78d08dc1a2d1b3da687c29d7ffeb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 20670, "upload_time": "2019-02-25T18:51:49", "url": "https://files.pythonhosted.org/packages/fc/9a/5a320d8c1bee38ae32ceb88f196db52de535a7f052cdba0d32cab148f774/xiax-0.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7bbb78d08dc1a2d1b3da687c29d7ffeb", "sha256": "4be7d8895d484167e1d86c03cda7e307d14140eeb85ecdaf7434a4553773cfc8" }, "downloads": -1, "filename": "xiax-0.6.0.tar.gz", "has_sig": false, "md5_digest": "7bbb78d08dc1a2d1b3da687c29d7ffeb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", "size": 20670, "upload_time": "2019-02-25T18:51:49", "url": "https://files.pythonhosted.org/packages/fc/9a/5a320d8c1bee38ae32ceb88f196db52de535a7f052cdba0d32cab148f774/xiax-0.6.0.tar.gz" } ] }