{ "info": { "author": "Wim Glenn", "author_email": "hey@wimglenn.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Archiving :: Packaging", "Topic :: System :: Systems Administration", "Topic :: Utilities" ], "description": "This project shows how to package data files within a Python distribution, and has some example code for reading the data files. To build this distribution, create a venv with setuptools, wheel, and pep517 installed, then execute the latter as a module:\n\n.. code-block:: bash\n\n python -m pep517.build .\n\nThe distributions (an sdist .tar.gz and a bdist .whl) will be written to ./dist/ subdirectory. To test it out, install the distribution and run the console script ``resources-example``.\n\nHere's a compatibility summary of the five approaches demonstrated:\n\n+-------------+---------------------+------------+---------------+---------------+-------------------+\n| Module | Description | In stdlib? | Works on Py2? | Works on Py3? | Works in zipfile? |\n+=============+=====================+============+===============+===============+===================+\n| example1.py | os.path.join | yes | yes | yes | no |\n+-------------+---------------------+------------+---------------+---------------+-------------------+\n| example2.py | pkgutil | yes | yes | yes | yes |\n+-------------+---------------------+------------+---------------+---------------+-------------------+\n| example3.py | pkg_resources | no | yes | yes | yes |\n+-------------+---------------------+------------+---------------+---------------+-------------------+\n| example4.py | importlib.resources | yes | no | yes (3.7+) | yes |\n+-------------+---------------------+------------+---------------+---------------+-------------------+\n| example5.py | importlib_resources | no | yes | yes | yes |\n+-------------+---------------------+------------+---------------+---------------+-------------------+\n\nIf you are interested in creating an executable zip from source, you can use stdlib `zipapp `_ utility (Python 3.5+):\n\n.. code-block:: bash\n\n python3 -m zipapp --compress /path/to/resources-example --main=\"myapp:main\" --output=myapp.zip\n\nAnd now you can run the zip directly with the interpreter (any Python version):\n\n.. code-block:: bash\n\n python myapp.zip\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wimglenn/resources-example", "keywords": "packaging,resources", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "resources-example", "package_url": "https://pypi.org/project/resources-example/", "platform": "", "project_url": "https://pypi.org/project/resources-example/", "project_urls": { "Homepage": "https://github.com/wimglenn/resources-example", "Issue Tracker": "https://github.com/wimglenn/resources-example/issues" }, "release_url": "https://pypi.org/project/resources-example/0.2/", "requires_dist": [ "setuptools", "importlib-resources" ], "requires_python": "", "summary": "An example project demonstrating various ways to access data files in Python package", "version": "0.2", "yanked": false, "yanked_reason": null }, "last_serial": 8040548, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "163c6208a438460c53981c3188e2d88c", "sha256": "e0651867ee891bf6196b77f66d26e88bb618f338dd8a55bf7d69041a5d48858a" }, "downloads": -1, "filename": "resources_example-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "163c6208a438460c53981c3188e2d88c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5146, "upload_time": "2019-10-29T05:15:47", "upload_time_iso_8601": "2019-10-29T05:15:47.598785Z", "url": "https://files.pythonhosted.org/packages/ea/50/fe925af0ad238a1c59dcb9d972340f79ce8c4ad6e6afb424fd63dab53a30/resources_example-0.1-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "9286a76c495a691748dfc501951c0a97", "sha256": "471ccda14cd87d244e801588fa30dc3de421bb95cb43e5b30f095192956349c8" }, "downloads": -1, "filename": "resources-example-0.1.tar.gz", "has_sig": false, "md5_digest": "9286a76c495a691748dfc501951c0a97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3086, "upload_time": "2019-10-29T05:18:54", "upload_time_iso_8601": "2019-10-29T05:18:54.989662Z", "url": "https://files.pythonhosted.org/packages/38/1c/4bea5a34ecae1609dfbacdaf083eb66241f03cd1b36038db0b24a01d9add/resources-example-0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.2": [ { "comment_text": "", "digests": { "md5": "5bd1e3af5ec1aedacf8b43e33ba60424", "sha256": "8171bbd50ffbb694f5e86d198fd556f8fd66c2a2537cd46e9406105119949418" }, "downloads": -1, "filename": "resources_example-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5bd1e3af5ec1aedacf8b43e33ba60424", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5673, "upload_time": "2020-08-26T04:25:57", "upload_time_iso_8601": "2020-08-26T04:25:57.662793Z", "url": "https://files.pythonhosted.org/packages/eb/6f/3414bcf5bb8fbe1c9c5b27e91cec9cc43199b8b503f0d987918e1f1a7c9d/resources_example-0.2-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "4af5bd0f5f933af16b71e2aad90a7e86", "sha256": "2308f460c40de7ce5bb200f65d11e98fd547e1ae45d4480cf63110450b11e5d8" }, "downloads": -1, "filename": "resources-example-0.2.tar.gz", "has_sig": false, "md5_digest": "4af5bd0f5f933af16b71e2aad90a7e86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4798, "upload_time": "2020-08-26T04:26:05", "upload_time_iso_8601": "2020-08-26T04:26:05.485801Z", "url": "https://files.pythonhosted.org/packages/34/c4/a6c9e13313c5d6806729feeebfff9e0c696f49f84522fbbbca5c5e20f507/resources-example-0.2.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5bd1e3af5ec1aedacf8b43e33ba60424", "sha256": "8171bbd50ffbb694f5e86d198fd556f8fd66c2a2537cd46e9406105119949418" }, "downloads": -1, "filename": "resources_example-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5bd1e3af5ec1aedacf8b43e33ba60424", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5673, "upload_time": "2020-08-26T04:25:57", "upload_time_iso_8601": "2020-08-26T04:25:57.662793Z", "url": "https://files.pythonhosted.org/packages/eb/6f/3414bcf5bb8fbe1c9c5b27e91cec9cc43199b8b503f0d987918e1f1a7c9d/resources_example-0.2-py2.py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "4af5bd0f5f933af16b71e2aad90a7e86", "sha256": "2308f460c40de7ce5bb200f65d11e98fd547e1ae45d4480cf63110450b11e5d8" }, "downloads": -1, "filename": "resources-example-0.2.tar.gz", "has_sig": false, "md5_digest": "4af5bd0f5f933af16b71e2aad90a7e86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4798, "upload_time": "2020-08-26T04:26:05", "upload_time_iso_8601": "2020-08-26T04:26:05.485801Z", "url": "https://files.pythonhosted.org/packages/34/c4/a6c9e13313c5d6806729feeebfff9e0c696f49f84522fbbbca5c5e20f507/resources-example-0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }