Skip to main content

A collection of useful datasets

Project 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:

python -m pep517.build .

The 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.

Here’s a compatibility summary of the five approaches demonstrated:

Module

Description

In stdlib?

Works on Py2?

Works on Py3?

Works in zipfile?

Run as script?*

example1.py

os.path.join

yes

yes

yes

no

yes

example2.py

pkgutil

yes

yes

yes

yes

no

example3.py

pkg_resources

no

yes

yes

yes

yes

example4.py

importlib.resources

yes

no

yes (3.7+)

yes

yes

example5.py

importlib_resources

no

yes

yes

yes

yes

* “Run as script” means executing the submodule directly, e.g. python myapp/example2.py. Note that Guido considers this an anti-pattern

If you are interested in creating an executable zip from source, you can use stdlib zipapp utility (Python 3.5+):

python3 -m zipapp --compress /path/to/resources-example --main="myapp:main" --output=myapp.zip

And now you can run the zip directly with the interpreter (any Python version):

python myapp.zip

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eccd_datasets-0.1.1.tar.gz (61.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eccd_datasets-0.1.1-py2.py3-none-any.whl (61.2 MB view details)

Uploaded Python 2Python 3

File details

Details for the file eccd_datasets-0.1.1.tar.gz.

File metadata

  • Download URL: eccd_datasets-0.1.1.tar.gz
  • Upload date:
  • Size: 61.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for eccd_datasets-0.1.1.tar.gz
Algorithm Hash digest
SHA256 29b4e33cef9e2b81c9b020359d15af68398ccc5d18c43116459c9be552e014a1
MD5 5f321c913bfa2e10657957af6d46f72c
BLAKE2b-256 41090624b844f749d45d47a1fd369548c72b28af9b4450805458b5693e604b8d

See more details on using hashes here.

File details

Details for the file eccd_datasets-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: eccd_datasets-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 61.2 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for eccd_datasets-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 61ccbda6681a0a224b6c10d31cf7c83dd6712f27297bda5978a077f85400a958
MD5 baeb114579b88f8a52faae9dae1e379c
BLAKE2b-256 6ab047810470372fb418545deef600d883490faf564903e463d6338505eb09fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page