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
Close
Hashes for python-sample-package-with-data-aitirga-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a18945e002dfe8438e912cdeea61ce76323f5802201fc3c3e50d8dd35c15ad8a |
|
MD5 | 710663f459e967437ac446b3b6e76fea |
|
BLAKE2b-256 | a7f5a1675084837d7ca3400f7a2c72b1767b24a7ce5d9c5912c780d92bd58794 |
Close
Hashes for python_sample_package_with_data_aitirga-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76cfecec23664e1eaf3ceb53bd40af7b3ecf64fe6c2a8bfd9eb6b0f955f256de |
|
MD5 | 69165768bf9d5315012dff5f0da2c1a5 |
|
BLAKE2b-256 | 708f48fb0df95fddfd18273bf8ba9ed5c7f62521c48c0fc3566005cffaa21c9b |