{ "info": { "author": "unfoldingWord", "author_email": "joel@neutrinographics.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "Master: [![Build Status](https://travis-ci.org/unfoldingWord-dev/python-resource-container.svg?branch=master)](https://travis-ci.org/unfoldingWord-dev/python-resource-container)\n\n# python-resource-container\nA utility for managing Door43 Resource Containers. This follows the specification at http://resource-container.readthedocs.io/en/v0.2/.\n\n## What is an RC?\nA Resource Container (RC) is a modular/portable package of translation data.\n\n## Installation\n```\npip install resource_container\n```\n\n## Requirements\n\npython 2.7+\n\n## Usage\nTo get started you must first load an RC. Then you can read/write as needed.\n\n```python\nfrom resource_container import factory\n\n\nrc = factory.load('/path/to/resource/container/dir')\n\n# some attributes have dedicated properties\nprint(rc.type)\n\n# other attributes are accessible from the manifest\nprint(rc.manifest['dublin_core']['rights'])\n\n# read\nchapter = rc.read_chunk('01', 'title')\n\n# write\nrc.write_chunk('front', 'title', 'Some book title')\n```\n\n### Multiple Projects\nIt is possible for an RC to contain multiple projects.\nIn such cases methods like writing and reading chunks will\nthrow an error telling you to specify the project.\n\n```python\n# assume rc contains the projects: gen, exo.\n\n# this throws an error\nrc.read_chunk('01', 'title')\n\n# you can check how many projects are in an rc\nrc.project_count\n\n# this works as expected\nchapter01title = rc.read_chunk('gen', '01', 'title')\n```\n\n### Strict Mode\n\nBy default the tool will operate in strict mode when loading an RC. \nThis will perform some checks to ensure the RC is valid.\nIf you need to look at an RC regardless of it's validity\nyou can disable strict mode by passing in `False`.\n\n```python\nrc = factory.load('/invalid/rc/dir', False)\n# do stuff with the invalid rc\n```\n\n\n### Creating an RC\n\nThis tool also allows you to create a brand new RC.\n\n> NOTE: currently you must specify the complete manifest manually.\n> This might change a little in the future.\n\n```python\nmanifest = {\n ...\n}\n\nrc = factory.create('/my/rc/dir/', manifest)\n# do stuff with your new rc\n```\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/unfoldingWord-dev/python-resource-container", "keywords": "rc,resource container,client", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "resource_container", "package_url": "https://pypi.org/project/resource_container/", "platform": "", "project_url": "https://pypi.org/project/resource_container/", "project_urls": { "Homepage": "https://github.com/unfoldingWord-dev/python-resource-container" }, "release_url": "https://pypi.org/project/resource_container/1.1/", "requires_dist": [ "pyyaml", "uw-tools" ], "requires_python": "", "summary": "A utility for managing Door43 Resource Containers", "version": "1.1" }, "last_serial": 3555009, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "4433dfb292759b365c45e8b180b58711", "sha256": "26624b5d099873ba4c971131c4941872bb7b5e65e0bc26abcb3a853744c698e3" }, "downloads": -1, "filename": "resource_container-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4433dfb292759b365c45e8b180b58711", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9772, "upload_time": "2017-05-22T23:11:37", "url": "https://files.pythonhosted.org/packages/e8/89/fb83e5b4be7ef24f07b0772e3b0d8032c11552b55e37e6d28a63117e088c/resource_container-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "967b1fe4401bd446a708aa3da8f3eeb8", "sha256": "7edb21248d0a65904ea5b433f2a86cd2e0c27757bf1e98186e720d60c30861a0" }, "downloads": -1, "filename": "resource_container-1.0.tar.gz", "has_sig": false, "md5_digest": "967b1fe4401bd446a708aa3da8f3eeb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6405, "upload_time": "2017-05-22T23:11:39", "url": "https://files.pythonhosted.org/packages/13/c1/c716ac343ae02c1ecced1f1b8e7be1e3d9a6ca2d19406247fda8d3d1680a/resource_container-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "8787059e95172ec1f862b4a3741716d7", "sha256": "348f05b24ad9aa9fd3f8b01a7fb58d660ce4f1b700dc72f8c10fbd263e2de757" }, "downloads": -1, "filename": "resource_container-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8787059e95172ec1f862b4a3741716d7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9822, "upload_time": "2018-02-05T23:07:24", "url": "https://files.pythonhosted.org/packages/5b/ab/93d0614f7877ef57bea4a71e075029411457296c27e801fc198dabbb6717/resource_container-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1761a55fd248d40c3a735a78157646ff", "sha256": "05043c14e2dc8d46c24eb321310594382f957e477ea9605a1664ff7a23b7d413" }, "downloads": -1, "filename": "resource_container-1.1.tar.gz", "has_sig": false, "md5_digest": "1761a55fd248d40c3a735a78157646ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6634, "upload_time": "2018-02-05T23:07:25", "url": "https://files.pythonhosted.org/packages/0c/1d/9412c45a33139a6c541a14e0f7dcd04683b97797354a40beb582128f9857/resource_container-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8787059e95172ec1f862b4a3741716d7", "sha256": "348f05b24ad9aa9fd3f8b01a7fb58d660ce4f1b700dc72f8c10fbd263e2de757" }, "downloads": -1, "filename": "resource_container-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8787059e95172ec1f862b4a3741716d7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9822, "upload_time": "2018-02-05T23:07:24", "url": "https://files.pythonhosted.org/packages/5b/ab/93d0614f7877ef57bea4a71e075029411457296c27e801fc198dabbb6717/resource_container-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1761a55fd248d40c3a735a78157646ff", "sha256": "05043c14e2dc8d46c24eb321310594382f957e477ea9605a1664ff7a23b7d413" }, "downloads": -1, "filename": "resource_container-1.1.tar.gz", "has_sig": false, "md5_digest": "1761a55fd248d40c3a735a78157646ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6634, "upload_time": "2018-02-05T23:07:25", "url": "https://files.pythonhosted.org/packages/0c/1d/9412c45a33139a6c541a14e0f7dcd04683b97797354a40beb582128f9857/resource_container-1.1.tar.gz" } ] }