{ "info": { "author": "di-dip-unistra", "author_email": "di-dip@unistra.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Python Software Foundation License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.4" ], "description": "rng-to-html-form\n================\n\n.. image:: https://api.travis-ci.org/unistra/rng-to-html-form.svg?branch=master\n :target: https://travis-ci.org/unistra/rng-to-html-form\n :alt: Build\n\n.. image:: http://coveralls.io/repos/unistra/rng-to-html-form/badge.png?branch=master\n :target: http://coveralls.io/r/unistra/rng-to-html-form?branch=master\n :alt: Coverage\n\n.. image:: https://img.shields.io/pypi/v/rng-to-html-form.svg\n :target: https://pypi.python.org/pypi/rng-to-html-form\n :alt: Version\n\n.. image:: https://img.shields.io/pypi/pyversions/rng-to-html-form.svg\n :target: https://pypi.python.org/pypi/rng-to-html-form\n :alt: Python Version\n\n.. image:: https://img.shields.io/pypi/status/rng-to-html-form.svg\n :target: https://pypi.python.org/pypi/rng-to-html-form\n :alt: Python Version\n\n.. image:: https://img.shields.io/pypi/l/rng-to-html-form.svg\n :target: https://docs.python.org/3/license.html\n :alt: Licence\n\nRequirements\n------------\n\n* python 3.4\n* lxml 3.4.4\n\nInstall\n-------\n\n.. code:: bash\n\n pip install rng-to-html-form\n\nUsage\n-----\n\nTakes an rng file and makes an html form :\n\n.. code:: python\n\n from rng_to_form.rng import RNG\n from rng_to_form.form_maker import make_form, make_tree, set_in_nested_dict, order_dicts\n\n \"\"\"\n List of rng tools\n \"\"\"\n\n # Creates an RNG object to use rng tools\n rng = RNG(file=\"/path/to/my/rng/file.rng\", target=\"ArchiveTransfer\")\n\n #\u00a01 - Tools to make the form\n\n # Builds an html form in a string\n generated_form = make_form(rng)\n # Returns elements order\n order = rng.find_definitions()\n # From the specified element, returns all nested orders\n form_root = rng.get_form_root(root_name=\"ArchiveTransfer\")\n\n #\u00a02 - Tools to get data from the form\n\n # Generates a dict of dicts from dot separated keys. Result will be : {'a': {'c': {}, 'b': {}}, 'b': {'d': {}, 'e': {'b': {}, 'a': {}}}}\n data = {'a.b': 1, 'a.c': 2, 'b.d' : 1, 'b.e.a': 1, 'b.e.b': 2}\n tree = make_tree(data)\n # Makes a nested python object from the form data. It modifies \"tree\"\n set_in_nested_dict(tree, data)\n # Builds the final python object with all ordered elements\n order = rng.find_definitions()\n all_data = {rng.get_form_root(root_name=\"ArchiveTransfer\"): tree}\n final = order_dicts(all_data, ordered=order)\n\n #\u00a03 - Tools to get data from the form\n\n #\u00a0Flattens nested dicts into a single level dict. Result will be : {'a.b': 1, 'a.c': 2, 'b.d' : 1, 'b.e.a': 1, 'b.e.b': 2}\n dp = dict_path({'a': {'b': 1, 'c': 2}, 'b': {'d': 1, 'e': {'a': 1, 'b': 2}}})\n\n\nAuthors\n-------\n\n* Geoffroy : https://github.com/orgs/unistra/people/geoffroybeck\n* Morgan : https://github.com/orgs/unistra/people/dotmobo", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/rng-to-html-form", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/unistra/rng-to-html-form", "keywords": "lxml,python,rng,xml,form,html", "license": "PSF", "maintainer": null, "maintainer_email": null, "name": "rng-to-html-form", "package_url": "https://pypi.org/project/rng-to-html-form/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rng-to-html-form/", "project_urls": { "Download": "http://pypi.python.org/pypi/rng-to-html-form", "Homepage": "https://github.com/unistra/rng-to-html-form" }, "release_url": "https://pypi.org/project/rng-to-html-form/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "Takes an rng file and makes an html form", "version": "1.0.2" }, "last_serial": 2754528, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "6635bc33487abe19a7b440add6a0c610", "sha256": "a573d43b9814a8b72f997979688ca41dc1106151a7c2df90bc351090734dc287" }, "downloads": -1, "filename": "rng_to_html_form-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6635bc33487abe19a7b440add6a0c610", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11607, "upload_time": "2016-11-21T13:32:02", "url": "https://files.pythonhosted.org/packages/ef/f3/4bc854e01241e6632e59bd9185d6882899a483585a74092ef8568c56e89d/rng_to_html_form-1.0.0-py3-none-any.whl" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "630cf857793c3e0c6595abb7fc5b2fee", "sha256": "d1eca68f341d330295477c679eb104e811b652844cbcda6300f5533fde017826" }, "downloads": -1, "filename": "rng_to_html_form-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "630cf857793c3e0c6595abb7fc5b2fee", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 11954, "upload_time": "2017-04-05T10:34:39", "url": "https://files.pythonhosted.org/packages/a3/26/9291579a966f994a2020a3cf738fec9dc4027417735c7ad64633c6a2de3a/rng_to_html_form-1.0.2-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "630cf857793c3e0c6595abb7fc5b2fee", "sha256": "d1eca68f341d330295477c679eb104e811b652844cbcda6300f5533fde017826" }, "downloads": -1, "filename": "rng_to_html_form-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "630cf857793c3e0c6595abb7fc5b2fee", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 11954, "upload_time": "2017-04-05T10:34:39", "url": "https://files.pythonhosted.org/packages/a3/26/9291579a966f994a2020a3cf738fec9dc4027417735c7ad64633c6a2de3a/rng_to_html_form-1.0.2-py3-none-any.whl" } ] }