{ "info": { "author": "Hal Blackburn", "author_email": "hwtb2@cam.ac.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup :: XML" ], "description": "rnginline: Flatten multi-file RELAX NG schemas\n==============================================\n\n.. image:: https://img.shields.io/travis/h4l/rnginline.svg\n :target: https://travis-ci.org/h4l/rnginline\n\n.. image:: https://img.shields.io/codecov/c/github/h4l/rnginline/master.svg\n :target: https://codecov.io/github/h4l/rnginline?ref=master\n\n.. image:: https://img.shields.io/pypi/v/rnginline.svg\n :target: https://pypi.python.org/pypi/rnginline\n\n.. image:: https://img.shields.io/badge/docs-latest-brightgreen.svg\n :target: http://rnginline.readthedocs.org/en/latest/\n\nrnginline is a Python library and command-line tool for loading multi-file\nRELAX NG schemas from arbitary URLs, and flattening them into a single RELAX NG\nschema.\n\n\nFeatures\n--------\n\n* Convert multi-file RNG schemas into one file **without breaking or\n restructuring the schemas**\n\n * Great care is taken to maintain the semantics of the separate schema files in the single output\n * The input documents are changed as little as possible, so the output is as readable as the input\n\n* Load schemas from:\n\n * The filesystem\n * From a Python package's data (without unpacking it to the filesystem)\n\n* command-line interface as well as a Python API\n* Test suite covering lots of edge cases, e.g. namespace handling\n\n * 100% line & branch code coverage\n\n\nQuickstart\n----------\n\nInstall with pip:\n\n.. code-block:: console\n\n $ pip install rnginline\n\nYou can use it from Python like this:\n\n.. code-block:: python\n\n >>> import rnginline\n >>> rnginline.inline('my-nested-schema-root.rng')\n \n\nYou can load a multi-file schema from a Python package's data like this:\n\n.. code-block:: python\n\n >>> import rnginline\n >>> from rnginline.urlhandlers import pydata\n >>> url = pydata.makeurl('rnginline.test',\n ... 'data/testcases/external-ref-1/schema.rng')\n >>> url\n 'pydata://rnginline.test/data/testcases/external-ref-1/schema.rng'\n >>> rnginline.inline(url)\n \n\nYou can use it from the command line like this:\n\n.. code-block:: console\n\n $ rnginline my-nested-schema-root.rng flattened-output.rng\n\n\nDocumentation\n-------------\n\nDocumentation is available at http://rnginline.readthedocs.org/\n\n\nMotivation\n----------\n\n``lxml`` has good support for using RELAX NG schemas, but lacks support for\nloading multi-file schemas from anywhere other than the filesystem. This is a\nproblem if you wish to bundle a multi-file schema with your Python\npackage/module. You'd have to depend on setuptools being available to use its\n`resource extraction`_, or use one of the existing RELAX NG merging tools to\nconvert your schema into a single file.\n\n.. _resource extraction: https://pythonhosted.org/setuptools/pkg_resources.html#resource-extraction\n\n\nExisting RELAX NG flattening tools\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe following projects didn't quite fit my needs, leading me to write rnginline.\nThey may work for you though.\n\n* `rng2srng `_ - Implements full\n simplification, so the structure of the input schema will be lost\n* `rng-incelim `_ - A similar project to\n this, implemented in XSLT. Unfortunately\n doesn't handle namespace declarations on ```` elements correctly.\n XSLT 1.0 doesn't support creating namespace nodes, so to fix this\n rng-incelim would have to resolve all QNames in the schema to NCNames with\n ns attributes, which would be undesirable for me.\n\n\nDeveloping\n----------\n\nAn `invoke `_ tasks file contains testing, doc\nbuilding, linting tasks. The tox config uses invoke to run tests over various\nPython versions.\n\nTo do a full test run, install tox (``$ pip install tox``) then run\n``$ tox`` from within the checked-out repo. This will take several minutes on\nthe first run, mainly due to the amount of time ``lxml`` takes to build from\nsource.\n\nTo run invoke tasks, ensure all the dev dependencies are installed:\n\n.. code-block:: console\n\n $ pip install -r requirements/all.txt\n $ invoke -l\n Available tasks:\n\n [\u2026]\n coverage Combine coverage of Python 2 and Python 3 test runs\n docs Build sphinx documentation\n docs_test Test the doctests in the Sphinx docs. Must be run with Python 3.\n pep8 Lint code for PEP 8 violations\n readme Lint the README for reStructuredText syntax issues\n test Run rnginline test suite\n $ invoke test\n ============================= test session starts ==============================\n platform darwin -- Python 2.7.8 -- py-1.4.26 -- pytest-2.6.4\n plugins: cov\n collected 346 items\n\n [\u2026]\n\nPrebuilding Wheels\n~~~~~~~~~~~~~~~~~~\n\nTo mitigate the time ``lxml`` takes to build, you can pre-build all the\ndependencies as Wheels into ``./wheelhouse`` and have pip use the pre-built\nwheels on every install. To do so, run:\n\n.. code-block:: console\n\n $ invoke cache_all_requirement_wheels\n $ export PIP_FIND_LINKS=$(pwd)/wheelhouse", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/h4l/rnginline", "keywords": "relaxng relax ng inline schema flatten lxml xml", "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "rnginline", "package_url": "https://pypi.org/project/rnginline/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rnginline/", "project_urls": { "Homepage": "https://github.com/h4l/rnginline" }, "release_url": "https://pypi.org/project/rnginline/0.0.2/", "requires_dist": [ "lxml", "docopt", "six", "pytest (>=2.6.4); extra == 'tests'", "mock; extra == 'tests'", "coverage; extra == 'tests'" ], "requires_python": null, "summary": "Flatten multi-file RELAX NG schemas", "version": "0.0.2" }, "last_serial": 1569160, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "59b5cfd4f498777cb027b6a6479c9d4c", "sha256": "c61aef50caed2a012f4f521568905c1d48a2bdb65930a40fb241ce425bb1e821" }, "downloads": -1, "filename": "rnginline-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "59b5cfd4f498777cb027b6a6479c9d4c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 78773, "upload_time": "2015-03-29T23:57:51", "url": "https://files.pythonhosted.org/packages/ab/d3/c98e0fd4a99621741d7d21b6c4b357cd90f0305cc4cc5b1d14b707bb9c75/rnginline-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a411935b806b81428e75d1a6f8803d84", "sha256": "2add350efdec569ec308eaefc74564753bec53d39649d24de83858e06cc21e93" }, "downloads": -1, "filename": "rnginline-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a411935b806b81428e75d1a6f8803d84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 63763, "upload_time": "2015-03-29T23:57:55", "url": "https://files.pythonhosted.org/packages/4c/28/1e5a94b18665100f629a291056374f7cec2883f48c14953e379875e1f080/rnginline-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "dcb1d667e2e8b4fb89a79a7415fa42c8", "sha256": "0cd329d21aedf3f27bb7da2e3177aae22ca4e6897a3a272bf9091cc12c6d323c" }, "downloads": -1, "filename": "rnginline-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dcb1d667e2e8b4fb89a79a7415fa42c8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 78592, "upload_time": "2015-05-30T15:43:14", "url": "https://files.pythonhosted.org/packages/5b/04/0fd99dd40f718a9e16a847750d5419b12bfed5b391fbdda9a78995038384/rnginline-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ee32790449adc0bb1ca38807ead40fbc", "sha256": "8f85b8cf01c0e3203a8801556bf2c32a9d3479e097dcf6e65a48ddd8b49419f9" }, "downloads": -1, "filename": "rnginline-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ee32790449adc0bb1ca38807ead40fbc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 64094, "upload_time": "2015-05-30T15:43:19", "url": "https://files.pythonhosted.org/packages/6d/41/6d8e6a1259ed386fb88f9961eff46c9c0edef614147b9b4c7ac057c375e2/rnginline-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dcb1d667e2e8b4fb89a79a7415fa42c8", "sha256": "0cd329d21aedf3f27bb7da2e3177aae22ca4e6897a3a272bf9091cc12c6d323c" }, "downloads": -1, "filename": "rnginline-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dcb1d667e2e8b4fb89a79a7415fa42c8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 78592, "upload_time": "2015-05-30T15:43:14", "url": "https://files.pythonhosted.org/packages/5b/04/0fd99dd40f718a9e16a847750d5419b12bfed5b391fbdda9a78995038384/rnginline-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ee32790449adc0bb1ca38807ead40fbc", "sha256": "8f85b8cf01c0e3203a8801556bf2c32a9d3479e097dcf6e65a48ddd8b49419f9" }, "downloads": -1, "filename": "rnginline-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ee32790449adc0bb1ca38807ead40fbc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 64094, "upload_time": "2015-05-30T15:43:19", "url": "https://files.pythonhosted.org/packages/6d/41/6d8e6a1259ed386fb88f9961eff46c9c0edef614147b9b4c7ac057c375e2/rnginline-0.0.2.tar.gz" } ] }