Group iNaturalist sightings into clumps by space and time
Project description
inaturalist-clumper
Group iNaturalist sightings into clumps, represented as JSON.
Given one or more iNaturalist user logins, this CLI fetches every public observation those users have recorded and groups sightings that happened within ~5 km and ~3 hours of each other into "clumps" — useful for reconstructing a single hike, birding session, or tide-pool visit as one record.
See simonw/inaturalist-clumps/blob/main/clumps.json for example output from this tool.
The output JSON file records, for every clump:
- start/end timestamps, duration, centroid, bounding box, span
- a species roll-up
- a
locationblock: the mode of the observations'place_guessplus the most-specific iNaturalist place that every observation in the clump falls inside (with abreadcrumbof ancestor place IDs) - per-observation: timestamp, latitude/longitude, identified taxon, user-typed
place_guess, iNatplace_ids, and photo URLs (thumbnail / large / original)
A top-level places dictionary caches the iNat place metadata (name, display_name, admin_level, ancestor_ids) for every ID that appears in a clump's breadcrumb, so the file is self-contained. Incremental runs reuse this cache and only fetch newly-referenced places.
Install
pip install inaturalist-clumper
Or:
uv tool install inaturalist-clumper
Usage
inaturalist-clumper simonw --output clumps.json
You can pass more than one iNaturalist username to gather sightings from multiple users accounts.
Options:
USERNAME ...— required
One or more iNaturalist user logins to fetch.--output— default:clumps.json
Output JSON path. Used as the basis for incremental runs if it exists.--distance-km— default:5.0
Spatial threshold for linking two observations into the same clump.--hours— default:3.0
Temporal threshold for linking two observations into the same clump.--full-refresh— default: off
Ignore any existing observations in the output file and re-fetch fully.
Incremental runs
A second invocation against the same --output file reads the existing data and asks the iNaturalist API for any observations that have been created or edited since the previous run's generated_at timestamp (using the updated_since parameter). Edited records overwrite the cached copy on merge, so corrected taxa, new photos, or fixed coordinates flow back in. The full set is then re-clumped and the file rewritten — so a new sighting that bridges two previous clumps will merge them.
Use --full-refresh to ignore the existing file and start over.
Development
Clone the repo and then:
uv run pytest
To run the development version:
uv run inaturalist-clumper --help
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inaturalist_clumper-0.1.tar.gz.
File metadata
- Download URL: inaturalist_clumper-0.1.tar.gz
- Upload date:
- Size: 34.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ede198ceea509909496576d6c167ab6c86b2c0ed8dd748d7f0fe903ebd0945c5
|
|
| MD5 |
62e3910b35fb86e372fedde6615bb0e3
|
|
| BLAKE2b-256 |
bede9bc8f3143305d87f461385c98be4ae5d031ccff9515adcb5b10d1f69e960
|
Provenance
The following attestation bundles were made for inaturalist_clumper-0.1.tar.gz:
Publisher:
publish.yml on simonw/inaturalist-clumper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inaturalist_clumper-0.1.tar.gz -
Subject digest:
ede198ceea509909496576d6c167ab6c86b2c0ed8dd748d7f0fe903ebd0945c5 - Sigstore transparency entry: 1551330748
- Sigstore integration time:
-
Permalink:
simonw/inaturalist-clumper@8b18af6f6bfddcbd51572571a1c230542a49ddd3 -
Branch / Tag:
refs/tags/0.1 - Owner: https://github.com/simonw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b18af6f6bfddcbd51572571a1c230542a49ddd3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file inaturalist_clumper-0.1-py3-none-any.whl.
File metadata
- Download URL: inaturalist_clumper-0.1-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aacd7a392a1574af2507965f91a36036c61eee047b163274633b0cb9cec2eff
|
|
| MD5 |
37640464fe71067323620e9726bfb973
|
|
| BLAKE2b-256 |
77b5e7c18d71a5edb9f457967eeeaa657575dc78e46484f1b2ebff0aa58ad973
|
Provenance
The following attestation bundles were made for inaturalist_clumper-0.1-py3-none-any.whl:
Publisher:
publish.yml on simonw/inaturalist-clumper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inaturalist_clumper-0.1-py3-none-any.whl -
Subject digest:
9aacd7a392a1574af2507965f91a36036c61eee047b163274633b0cb9cec2eff - Sigstore transparency entry: 1551330772
- Sigstore integration time:
-
Permalink:
simonw/inaturalist-clumper@8b18af6f6bfddcbd51572571a1c230542a49ddd3 -
Branch / Tag:
refs/tags/0.1 - Owner: https://github.com/simonw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b18af6f6bfddcbd51572571a1c230542a49ddd3 -
Trigger Event:
release
-
Statement type: