This commit is contained in:
2026-04-10 15:06:59 +02:00
parent 3031b7153b
commit e5a4711004
7806 changed files with 1918528 additions and 335 deletions

View File

@@ -0,0 +1,250 @@
Metadata-Version: 2.4
Name: pooch
Version: 1.9.0
Summary: A friend to fetch your data files
Author-email: The Pooch Developers <fatiandoaterra@protonmail.com>
Maintainer-email: Leonardo Uieda <leo@uieda.com>
License-Expression: BSD-3-Clause
Project-URL: Documentation, https://www.fatiando.org/pooch
Project-URL: Changelog, https://www.fatiando.org/pooch/latest/changes.html
Project-URL: Bug Tracker, https://github.com/fatiando/pooch/issues
Project-URL: Source Code, https://github.com/fatiando/pooch
Keywords: data,download,caching,http
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt
License-File: AUTHORS.md
Requires-Dist: platformdirs>=2.5.0
Requires-Dist: packaging>=20.0
Requires-Dist: requests>=2.19.0
Provides-Extra: progress
Requires-Dist: tqdm<5.0.0,>=4.41.0; extra == "progress"
Provides-Extra: sftp
Requires-Dist: paramiko>=2.7.0; extra == "sftp"
Provides-Extra: xxhash
Requires-Dist: xxhash>=1.4.3; extra == "xxhash"
Provides-Extra: test
Requires-Dist: pytest-httpserver; extra == "test"
Requires-Dist: pytest-localftpserver; extra == "test"
Dynamic: license-file
<img src="https://github.com/fatiando/pooch/raw/main/doc/_static/readme-banner.png" alt="Pooch: A friend to fetch your data files">
<p align="center">
<a href="https://www.fatiando.org/pooch"><strong>Documentation</strong> (latest)</a> •
<a href="https://www.fatiando.org/pooch/dev"><strong>Documentation</strong> (main branch)</a> •
<a href="https://github.com/fatiando/pooch/blob/main/CONTRIBUTING.md"><strong>Contributing</strong></a> •
<a href="https://www.fatiando.org/contact/"><strong>Contact</strong></a> •
<a href="https://github.com/orgs/fatiando/discussions"><strong>Ask a question</strong></a>
</p>
<p align="center">
Part of the <a href="https://www.fatiando.org"><strong>Fatiando a Terra</strong></a> project
</p>
<p align="center">
<a href="https://pypi.python.org/pypi/pooch"><img src="http://img.shields.io/pypi/v/pooch.svg?style=flat-square" alt="Latest version on PyPI"></a>
<a href="https://github.com/conda-forge/pooch-feedstock"><img src="https://img.shields.io/conda/vn/conda-forge/pooch.svg?style=flat-square" alt="Latest version on conda-forge"></a>
<a href="https://codecov.io/gh/fatiando/pooch"><img src="https://img.shields.io/codecov/c/github/fatiando/pooch/main.svg?style=flat-square" alt="Test coverage status"></a>
<a href="https://pypi.python.org/pypi/pooch"><img src="https://img.shields.io/pypi/pyversions/pooch.svg?style=flat-square" alt="Compatible Python versions."></a>
<a href="https://doi.org/10.21105/joss.01943"><img src="https://img.shields.io/badge/doi-10.21105%2Fjoss.01943-blue?style=flat-square" alt="DOI used to cite Pooch"></a>
</p>
## About
> Just want to download a file without messing with `requests` and `urllib`?
> Trying to add sample datasets to your Python package?
> **Pooch is here to help!**
*Pooch* is a **Python library** that can manage data by **downloading files**
from a server (only when needed) and storing them locally in a data **cache**
(a folder on your computer).
* Pure Python and minimal dependencies.
* Download files over HTTP, FTP, and from data repositories like Zenodo and figshare.
* Built-in post-processors to unzip/decompress the data after download.
* Designed to be extended: create custom downloaders and post-processors.
Are you a **scientist** or researcher? Pooch can help you too!
* Host your data on a repository and download using the DOI.
* Automatically download data using code instead of telling colleagues to do it themselves.
* Make sure everyone running the code has the same version of the data files.
## Projects using Pooch
[SciPy](https://github.com/scipy/scipy),
[scikit-image](https://github.com/scikit-image/scikit-image),
[xarray](https://github.com/pydata/xarray),
[Ensaio](https://github.com/fatiando/ensaio),
[GemPy](https://github.com/cgre-aachen/gempy),
[MetPy](https://github.com/Unidata/MetPy),
[napari](https://github.com/napari/napari),
[Satpy](https://github.com/pytroll/satpy),
[yt](https://github.com/yt-project/yt),
[PyVista](https://github.com/pyvista/pyvista),
[icepack](https://github.com/icepack/icepack),
[histolab](https://github.com/histolab/histolab),
[seaborn-image](https://github.com/SarthakJariwala/seaborn-image),
[Open AR-Sandbox](https://github.com/cgre-aachen/open_AR_Sandbox),
[climlab](https://github.com/climlab/climlab),
[mne-python](https://github.com/mne-tools/mne-python),
[GemGIS](https://github.com/cgre-aachen/gemgis),
[SHTOOLS](https://github.com/SHTOOLS/SHTOOLS),
[MOABB](https://github.com/NeuroTechX/moabb),
[GeoViews](https://github.com/holoviz/geoviews),
[ScopeSim](https://github.com/AstarVienna/ScopeSim),
[Brainrender](https://github.com/brainglobe/brainrender),
[pyxem](https://github.com/pyxem/pyxem),
[cellfinder](https://github.com/brainglobe/cellfinder),
[PVGeo](https://github.com/OpenGeoVis/PVGeo),
[geosnap](https://github.com/oturns/geosnap),
[BioCypher](https://github.com/biocypher/biocypher),
[cf-xarray](https://github.com/xarray-contrib/cf-xarray),
[Scirpy](https://github.com/scverse/scirpy),
[rembg](https://github.com/danielgatis/rembg),
[DASCore](https://github.com/DASDAE/dascore),
[scikit-mobility](https://github.com/scikit-mobility/scikit-mobility),
[Py-ART](https://github.com/ARM-DOE/pyart),
[HyperSpy](https://github.com/hyperspy/hyperspy),
[RosettaSciIO](https://github.com/hyperspy/rosettasciio),
[eXSpy](https://github.com/hyperspy/exspy),
[SPLASH](https://github.com/Adam-Boesky/astro_SPLASH),
[xclim](https://github.com/Ouranosinc/xclim),
[CLISOPS](https://github.com/roocs/clisops),
[scXpand](https://github.com/yizhak-lab-ccg/scXpand)
> If you're using Pooch, **send us a pull request** adding your project to the list.
## Example
For a **scientist downloading a data file** for analysis:
```python
import pooch
import pandas as pd
# Download a file and save it locally, returning the path to it.
# Running this again will not cause a download. Pooch will check the hash
# (checksum) of the downloaded file against the given value to make sure
# it's the right file (not corrupted or outdated).
fname_bathymetry = pooch.retrieve(
url="https://github.com/fatiando-data/caribbean-bathymetry/releases/download/v1/caribbean-bathymetry.csv.xz",
known_hash="md5:a7332aa6e69c77d49d7fb54b764caa82",
)
# Pooch can also download based on a DOI from certain providers.
fname_gravity = pooch.retrieve(
url="doi:10.5281/zenodo.5882430/southern-africa-gravity.csv.xz",
known_hash="md5:1dee324a14e647855366d6eb01a1ef35",
)
# Load the data with Pandas
data_bathymetry = pd.read_csv(fname_bathymetry)
data_gravity = pd.read_csv(fname_gravity)
```
For **package developers** including sample data in their projects:
```python
"""
Module mypackage/datasets.py
"""
from importlib import resources
import pandas
import pooch
# Get the version string from your project. You have one of these, right?
from . import version
# Create a new friend to manage your sample data storage
GOODBOY = pooch.create(
# Folder where the data will be stored. For a sensible default, use the
# default cache folder for your OS.
path=pooch.os_cache("mypackage"),
# Base URL of the remote data store. Will call .format on this string
# to insert the version (see below).
base_url="https://github.com/myproject/mypackage/raw/{version}/data/",
# Pooches are versioned so that you can use multiple versions of a
# package simultaneously. Use PEP440 compliant version number. The
# version will be appended to the path.
version=version,
# If a version as a "+XX.XXXXX" suffix, we'll assume that this is a dev
# version and replace the version with this string.
version_dev="main",
# An environment variable that overwrites the path.
env="MYPACKAGE_DATA_DIR",
# The cache file registry. A dictionary with all files managed by this
# pooch. Keys are the file names (relative to *base_url*) and values
# are their respective SHA256 hashes. Files will be downloaded
# automatically when needed (see fetch_gravity_data).
registry={"gravity-data.csv": "89y10phsdwhs09whljwc09whcowsdhcwodcydw"}
)
# You can also load the registry from a file. Each line contains a file
# name and it's sha256 hash separated by a space. This makes it easier to
# manage large numbers of data files. The registry file should be packaged
# and distributed with your software.
GOODBOY.load_registry(
resources.open_text("mypackage", "registry.txt")
)
# Define functions that your users can call to get back the data in memory
def fetch_gravity_data():
"""
Load some sample gravity data to use in your docs.
"""
# Fetch the path to a file in the local storage. If it's not there,
# we'll download it.
fname = GOODBOY.fetch("gravity-data.csv")
# Load it with numpy/pandas/etc
data = pandas.read_csv(fname)
return data
```
## Getting involved
🗨️ **Contact us:**
Find out more about how to reach us at
[fatiando.org/contact](https://www.fatiando.org/contact/).
👩🏾‍💻 **Contributing to project development:**
Please read our
[Contributing Guide](https://github.com/fatiando/pooch/blob/main/CONTRIBUTING.md)
to see how you can help and give feedback.
🧑🏾‍🤝‍🧑🏼 **Code of conduct:**
This project is released with a
[Code of Conduct](https://github.com/fatiando/community/blob/main/CODE_OF_CONDUCT.md).
By participating in this project you agree to abide by its terms.
> **Imposter syndrome disclaimer:**
> We want your help. **No, really.** There may be a little voice inside your
> head that is telling you that you're not ready, that you aren't skilled
> enough to contribute. We assure you that the little voice in your head is
> wrong. Most importantly, **there are many valuable ways to contribute besides
> writing code**.
>
> *This disclaimer was adapted from the*
> [MetPy project](https://github.com/Unidata/MetPy).
## License
This is free software: you can redistribute it and/or modify it under the terms
of the **BSD 3-clause License**. A copy of this license is provided in
[`LICENSE.txt`](https://github.com/fatiando/pooch/blob/main/LICENSE.txt).

View File

@@ -0,0 +1,57 @@
pooch-1.9.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pooch-1.9.0.dist-info/METADATA,sha256=emex-6hXV0gnaxq-4NsNDH1nPR9Pj0BGmelJ8TWdqWI,10926
pooch-1.9.0.dist-info/RECORD,,
pooch-1.9.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
pooch-1.9.0.dist-info/licenses/AUTHORS.md,sha256=ZADcWyPTxWyVWrgsRP5J2yQtTZptm4D1V12LnM28RjE,3225
pooch-1.9.0.dist-info/licenses/LICENSE.txt,sha256=rwSC1Z_HqdaNn2RoLHTObopGhEBrs6IaGRrjKZUJFrQ,1496
pooch-1.9.0.dist-info/top_level.txt,sha256=obom5VVMRubsFhFGNJpD4mAEkAVBqEa-xSVQ5uxNNQU,6
pooch/__init__.py,sha256=1s1Kpg1FH4puSh0wspfrv1V1_sSLo-R0-CcvEnghiBQ,1898
pooch/__pycache__/__init__.cpython-312.pyc,,
pooch/__pycache__/_version.cpython-312.pyc,,
pooch/__pycache__/core.cpython-312.pyc,,
pooch/__pycache__/downloaders.cpython-312.pyc,,
pooch/__pycache__/hashes.cpython-312.pyc,,
pooch/__pycache__/processors.cpython-312.pyc,,
pooch/__pycache__/utils.cpython-312.pyc,,
pooch/_version.py,sha256=AtjxHq9kv-0yMAzRwHHBjgcgVwDgXpdcdWCOAtKF-sQ,704
pooch/core.py,sha256=Mr3WS0QFKcopVQT0KKz7RLX5aV4Pe_QFG0g1ZmDOHaQ,33268
pooch/downloaders.py,sha256=qvSqtYf5jxZ5QbHFRYET1NmHsR0duhDDX1aCgfP4OEQ,43219
pooch/hashes.py,sha256=b1Ip3kEzgkW1yUs3wr7WebyvO-MbRn1FD8kD5ig2_MM,7069
pooch/processors.py,sha256=8Q_RuhD8wEHEzbFsYt678W1BlWtSdyLkRFwTYdeFL0M,16030
pooch/tests/__init__.py,sha256=MmdJHFLzh7lAd20PxF9YEhEZBQ5dX7sZ8IxaOBCNd3w,225
pooch/tests/__pycache__/__init__.cpython-312.pyc,,
pooch/tests/__pycache__/test_core.cpython-312.pyc,,
pooch/tests/__pycache__/test_downloaders.cpython-312.pyc,,
pooch/tests/__pycache__/test_hashes.cpython-312.pyc,,
pooch/tests/__pycache__/test_integration.cpython-312.pyc,,
pooch/tests/__pycache__/test_processors.cpython-312.pyc,,
pooch/tests/__pycache__/test_utils.cpython-312.pyc,,
pooch/tests/__pycache__/test_version.cpython-312.pyc,,
pooch/tests/__pycache__/utils.cpython-312.pyc,,
pooch/tests/data/large-data.txt,sha256=mN4XH7Mg2oKYLmvw85lBif_0tCsjModpr84SvdNAREo,102077
pooch/tests/data/registry-custom-url.txt,sha256=QmwZrr5VL4X_OeDy-nQ1bPcKo4UZyAnjRWb6MMZTsPc,838
pooch/tests/data/registry-invalid.txt,sha256=RNPHyh7bQn0rCTYK6yHYBm6jonXZhFT6ghAe6czAQHM,136
pooch/tests/data/registry-spaces.txt,sha256=Ak1fDFRq-LJyrCQbVMveQRU-fmvaCYWNlT5Pk7IcgaQ,177
pooch/tests/data/registry.txt,sha256=cAYprVgjJwJ-4QlC2l5xtdgL6XNvH7--Jd6OjGkJb5U,808
pooch/tests/data/registry_comments.txt,sha256=GdAL20h1baBuv2J9TQtbBTm38ys_aEojr7lwv78bjqE,855
pooch/tests/data/store.tar.gz,sha256=CIx_Tg8YWbHHabtgZd4kN282Y3SBft6GkaasLknylRE,243
pooch/tests/data/store.zip,sha256=BJjSoAHnEFG70qzSNG842ny9NFpjPLe_D4ogk4cUtRo,780
pooch/tests/data/store/subdir/tiny-data.txt,sha256=uu4IlNuhSxIIXqyyBChLl-Ni9PPlpYB2k8yQ70FcGy0,59
pooch/tests/data/store/tiny-data.txt,sha256=uu4IlNuhSxIIXqyyBChLl-Ni9PPlpYB2k8yQ70FcGy0,59
pooch/tests/data/tiny-data.tar.gz,sha256=QVA_CDgU9DoBqOmjDCjXqf6Wg5qZcnp_3QrPfNW6tjs,176
pooch/tests/data/tiny-data.txt,sha256=uu4IlNuhSxIIXqyyBChLl-Ni9PPlpYB2k8yQ70FcGy0,59
pooch/tests/data/tiny-data.txt.bz2,sha256=dTZjaHpAQMkMhXgGGGfR32I-aqgBHIcKXb2I7jyC4wY,91
pooch/tests/data/tiny-data.txt.gz,sha256=Li2mFhKRZXYXwyGS26lWNXBq-AxuczV1CBKQe1j9S1I,91
pooch/tests/data/tiny-data.txt.xz,sha256=mdy1wypukWNEustLrcvC8rbuGWl30dgYdhDCHn5gd2U,116
pooch/tests/data/tiny-data.zip,sha256=DUnpTwe8GGbsV-f9G5OjUfujaELsmxPdUL-U6N-jXLs,235
pooch/tests/test_core.py,sha256=HeDk7knkZfc7MV60kSGP4uFFQdd4ao1arsniedqrsu0,26623
pooch/tests/test_downloaders.py,sha256=U-ZWUiJcKKmrjSowzWcWyxSKwEhGIwNm2MEi55pY3Wg,20244
pooch/tests/test_hashes.py,sha256=HIT28DiYJDjt0YHz40HIgC08WKR2luh6kMwaFSsQmws,7346
pooch/tests/test_integration.py,sha256=-aKV8nEbuQZI0AzoF-ujm2w5XZKqvlKRjh8l_oGJzC4,1686
pooch/tests/test_processors.py,sha256=ExOsUdW1T6qjBvhF4pL_kITJ5WM2zq9CHGioM5nj2pM,11101
pooch/tests/test_utils.py,sha256=g4ujEul7HhZHNHUZ-riWRuFJVA3di7IGpTN3vYKXF9Q,6452
pooch/tests/test_version.py,sha256=RVw3MpWw6P6jB1Ap2Shx64zEs1a6NBP2cRFT097XDy8,545
pooch/tests/utils.py,sha256=llkfzkgmJt12ENIQmpvWLQnrqgFrXdw8TF_XZFZ1bzk,6769
pooch/typing/__init__.py,sha256=8wnKWTLJQRSEEc1c7n1R5LhBr-r7PSr9oMXbgX9OKHU,1582
pooch/typing/__pycache__/__init__.cpython-312.pyc,,
pooch/utils.py,sha256=r1wIijA_bmU-tBYG6WM5TSyVQDyPQZtbBc6xks7m92k,10912

View File

@@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: setuptools (80.10.2)
Root-Is-Purelib: true
Tag: py3-none-any

View File

@@ -0,0 +1,25 @@
# Project Authors
The following people have made contributions to the project (in alphabetical
order by last name) and are considered "The Pooch Developers":
* [Anderson Banihirwe](https://github.com/andersy005) - The US National Center for Atmospheric Research, USA (ORCID: [0000-0001-6583-571X](https://orcid.org/0000-0001-6583-571X))
* [Genevieve Buckley](https://github.com/GenevieveBuckley) - Monash University, Australia - (ORCID: [0000-0003-2763-492X](https://orcid.org/0000-0003-2763-492X))
* [Luke Gregor](https://github.com/lukegre) - Environmental Physics, ETH Zurich, Zurich, Switzerland (ORCID: [0000-0001-6071-1857](https://orcid.org/0000-0001-6071-1857))
* [Mathias Hauser](https://github.com/mathause) - Institute for Atmospheric and Climate Science, ETH Zurich, Zurich, Switzerland (ORCID: [0000-0002-0057-4878](https://orcid.org/0000-0002-0057-4878))
* [Mark Harfouche](https://github.com/hmaarrfk) - Ramona Optics Inc. - [0000-0002-4657-4603](https://orcid.org/0000-0002-4657-4603)
* [Danilo Horta](https://github.com/horta) - EMBL-EBI, UK
* [Hugo van Kemenade](https://github.com/hugovk) - Independent (Non-affiliated) (ORCID: [0000-0001-5715-8632](https://www.orcid.org/0000-0001-5715-8632))
* [Dominic Kempf](https://github.com/dokempf) - Scientific Software Center, Heidelberg University, Germany (ORCID: [0000-0002-6140-2332](https://www.orcid.org/0000-0002-6140-2332))
* [Kacper Kowalik](https://github.com/Xarthisius) - National Center for Supercomputing Applications, University of Illinois at Urbana-Champaign, USA (ORCID: [0000-0003-1709-3744](https://www.orcid.org/0000-0003-1709-3744))
* [John Leeman](https://github.com/jrleeman)
* [Björn Ludwig](https://github.com/BjoernLudwigPTB) - Physikalisch-Technische Bundesanstalt, Germany (ORCID: [0000-0002-5910-9137](https://www.orcid.org/0000-0002-5910-9137))
* [Daniel McCloy](https://github.com/drammock) - University of Washington, USA (ORCID: [0000-0002-7572-3241](https://orcid.org/0000-0002-7572-3241))
* [Juan Nunez-Iglesias](https://github.com/jni) - Monash University, Australia (ORCID: [0000-0002-7239-5828](https://orcid.org/0000-0002-7239-5828))
* [Rémi Rampin](https://github.com/remram44) - New York University, USA (ORCID: [0000-0002-0524-2282](https://www.orcid.org/0000-0002-0524-2282))
* [Clément Robert](https://github.com/neutrinoceros) - Institut de Planétologie et d'Astrophysique de Grenoble, France (ORCID: [0000-0001-8629-7068](https://orcid.org/0000-0001-8629-7068))
* [Daniel Shapero](https://github.com/danshapero) - Polar Science Center, University of Washington Applied Physics Lab, USA (ORCID: [0000-0002-3651-0649](https://www.orcid.org/0000-0002-3651-0649))
* [Santiago Soler](https://github.com/santisoler) - Department of Earth, Ocean and Atmospheric Sciences, University of British Columbia (ORCID: 0000-0001-9202-5317)
* [Matthew Turk](https://github.com/matthewturk) - University of Illinois at Urbana-Champaign, USA (ORCID: [0000-0002-5294-0198](https://www.orcid.org/0000-0002-5294-0198))
* [Leonardo Uieda](https://github.com/leouieda) - Universidade de São Paulo, Brazil (ORCID: [0000-0001-6123-9515](https://www.orcid.org/0000-0001-6123-9515))
* [Antonio Valentino](https://github.com/avalentino)

View File

@@ -0,0 +1,25 @@
Copyright (c) 2018 The Pooch Developers
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holders nor the names of any contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.