This release is a pre-release and may not be stable for production use.
🌳 GBIF Image Downloader
This project automatically downloads taxon-specific images from the GBIF API, processes them, and stores both images and metadata in a taxonomically organized structure in a MinIO bucket.
Features
- Loads Latin taxon names from
.csvor.xlsxfiles - Resolves
taxonKeysautomatically via the GBIF API - Downloads associated media (images) from GBIF
- Stores metadata and images in a taxonomic folder structure in MinIO
- Optionally processes only new GBIF occurrences (
crawl_new_entries) - Multithreading for parallel processing and uploads
- Logging directly to MinIO
Usage
Installation
Install dependencies via:
pip install -r requirements.txt
1. Prepare your input file
Create a .csv or .xlsx file with at least the following column:
| latin_name |
|---|
| Quercus robur |
| Fagus sylvatica |
2. Adjust your configuration
Edit the file config/config.yaml to set your MinIO connection, output paths, and processing options.
A typical configuration looks like this:
minio:
bucket: meinewaldki-gbif # Name of your MinIO bucket
endpoint: s3.anhalt.ai # MinIO/S3 endpoint URL
secure: true # Use HTTPS (true/false)
cert_check: true # Check SSL certificates (true/false)
paths:
output: gbif-test/ # Output directory for images and metadata
tree_list_input_path: data/tree_list.xlsx # Path to your input taxon list
processed_tree_list_path: data/species_key.csv # Path for the processed taxonKey list
log_dir: logs/ # Directory for log files
query_params:
mediaType: StillImage # Only download images
limit: 100 # Number of records per API call
offset: 0 # Start offset
options:
already_preprocessed: True # Set False to process the taxon list again
crawl_new_entries: False # Only process new occurrences if True
max_threads: 10 # Number of parallel threads for downloads/uploads
Query Parameters for GBIF API URL
The parameters used to build the GBIF API request URL are defined in the query_params section of your
config/config.yaml. These parameters control which records are fetched from the GBIF API.
Supported parameters:
mediaType(e.g.StillImage): Only download records with images.taxonKey: The taxon key.datasetKey: Filter by dataset.country: Filter by country code (e.g.DEfor Germany).hasCoordinate: Only records with coordinates (trueorfalse).year,month: Filter by year or month of occurrence.basisOfRecord: Type of record (e.g.HUMAN_OBSERVATION).recordedBy: Filter by collector/observer.institutionCode,collectionCode: Filter by institution or collection.limit: Number of records per API call (pagination, max. 300).offset: Start offset for pagination.
How it works:
- All parameters in
query_paramsare automatically validated at startup. - Only the above parameters are allowed. Invalid parameters will cause the program to stop with an error.
3. Process taxonKey list and resolve taxonKeys
from anhaltai.gbif_downloader.tree_list_processor import TreeListProcessor
processor = TreeListProcessor(input_path="data/tree_list.xlsx",
sheet_name="Gehölzarten", taxon="speciesKey")
processor.process_tree_list(output_path="data/species_key.csv")
4. Download media and metadata from GBIF
Run the main program:
PYTHONPATH=src python3 src/gbif_extractor/main.py
Note:
- MinIO credentials must be set in
.envsee.env-examplefor the required format. - Log files are automatically uploaded to MinIO.
- Parallel processing and uploads are controlled by a configurable thread limit.
- Semaphores are used in this project to control the number of concurrent threads during uploads to MinIO.
- The program will skip old entries if
crawl_new_entriesis set toTrue.
Metadata
Release files for anhaltai-gbif-downloader 2025.9.dev16345
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anhaltai_gbif_downloader-2025.9.dev16345.tar.gz | 15.4 kB | Without provenance | Details for anhaltai_gbif_downloader-2025.9.dev16345.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anhaltai_gbif_downloader-2025.9.dev16345-py3-none-any.whl | Python 3 | none | any | Details for anhaltai_gbif_downloader-2025.9.dev16345-py3-none-any.whl |
Total release size: 32.0 kB
Release files / anhaltai_gbif_downloader-2025.9.dev16345.tar.gz
| Download URL | anhaltai_gbif_downloader-2025.9.dev16345.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9da13d78d309ddaa292682ba389b63938beac409cd52bfc3f7ddf4c6513dc3f3
|
|
BLAKE2b-256 checksum How to use checksums |
b8e5b5ea8d8ef859f08ff48f0edfafae9cbdf3170a3db7973efc8d009ba163b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / anhaltai_gbif_downloader-2025.9.dev16345-py3-none-any.whl
| Download URL | anhaltai_gbif_downloader-2025.9.dev16345-py3-none-any.whl |
|---|---|
| Size | 16.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f2bfd391e14c223a2594395c42d10395d3a25598be0d7bc573ebd0371f5caf8
|
|
BLAKE2b-256 checksum How to use checksums |
6b8bdd65ad8b0ec503ce7c7e172b97dcaee33690b019b56fe8be86d48d5b9721
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Security for anhaltai-gbif-downloader 2025.9.dev16345
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.