Pooch is a Python library designed to simplify the management and fetching of data files. It automatically downloads files from remote servers (supporting HTTP, FTP, Zenodo, and Figshare) only when they are needed, stores them in a local cache, and ensures data integrity through SHA256 hash checks. This makes it ideal for Python libraries distributing sample datasets or for scientists managing research data. The current version is 1.9.0, with a release cadence that typically spans several months to a year between minor versions, reflecting ongoing development and stability.
pip install poochVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up a `Pooch` instance, register a data file with its URL and SHA256 hash, and then fetch it. `Pooch` will automatically download the file if it's not present or if its hash doesn't match, otherwise it will return the path to the cached file. The example uses a temporary directory for the cache for demonstration purposes; in a production library, `pooch.os_cache('your_library_name')` is recommended for persistent caching.
Use a reliable method to compute the SHA256 hash of your hosted file. Pooch's `get_sha256()` utility can assist in verifying or generating hashes for local files before adding them to the registry.
Structure your remote data, for example on GitHub, so that specific versions (e.g., tags like `v1.0.0`) correspond to paths used in `base_url`. The `{version}` placeholder in `base_url` is crucial for this.Verify the integrity of the remote file and update the hash in your `pooch.create()` registry if the file has legitimately changed. If the file is corrupted, re-upload a correct version.
Document clearly for users any environment variables that can override the cache location. Ensure the target directory is writable by the user running the application.
No dependency data recorded yet.