My short description
Project description
Python sample package with data
How to distribute a Python package with data.
Tested on Ubuntu 19.10, Python 3.7.5, wheel==0.32.3, setuptools==41.1.0, twine==3.1.1.
How end users use the package from https://pypi.org/project/python-sample-package-with-data/:
python3 -m pip install --user python-sample-package-with-data
python-sample-package-with-data
Expected output:
hello data
which are the contents of our test data file python_sample_package_with_data/mydata.txt that was distributed with pip
.
How maintainers publish it:
# One time setup.
python3 -m pip install --user setuptools wheel twine
# Every time you want to publish.
python setup.py sdist bdist_wheel
twine upload dist/*
rm -rf build dist *.egg-info
Bibliography:
- https://stackoverflow.com/questions/47577762/how-do-i-distribute-my-pip-package-with-data-files-correctly
- https://stackoverflow.com/questions/47817944/python-pkg-resources-and-file-access-in-packages
- https://stackoverflow.com/questions/39104/finding-a-file-in-a-python-module-distribution
- https://stackoverflow.com/questions/14211575/any-python-function-to-get-data-files-root-directory
- https://stackoverflow.com/questions/14422340/manifest-in-package-data-and-data-files-clarification
- https://stackoverflow.com/questions/11235820/setup-py-not-installing-data-files
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-sample-package-with-data-aitirga-0.0.3.tar.gz
.
File metadata
- Download URL: python-sample-package-with-data-aitirga-0.0.3.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a18945e002dfe8438e912cdeea61ce76323f5802201fc3c3e50d8dd35c15ad8a |
|
MD5 | 710663f459e967437ac446b3b6e76fea |
|
BLAKE2b-256 | a7f5a1675084837d7ca3400f7a2c72b1767b24a7ce5d9c5912c780d92bd58794 |
File details
Details for the file python_sample_package_with_data_aitirga-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: python_sample_package_with_data_aitirga-0.0.3-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76cfecec23664e1eaf3ceb53bd40af7b3ecf64fe6c2a8bfd9eb6b0f955f256de |
|
MD5 | 69165768bf9d5315012dff5f0da2c1a5 |
|
BLAKE2b-256 | 708f48fb0df95fddfd18273bf8ba9ed5c7f62521c48c0fc3566005cffaa21c9b |