TERN ecoplots data access library
Project description
EcoPlots Python Library
Python client for discovering, filtering, and retrieving ecological field data from the TERN EcoPlots Portal. Pagination, streaming, and response normalisation are handled automatically — you get back a clean pandas.DataFrame, geopandas.GeoDataFrame, or GeoJSON (for observations) with no post-processing required.
Features
Data access
- 🔬 Observations & Samples — Two purpose-built workflows covering ecological plot observations and physical material samples (soil, plant vouchers, tissue) from TERN's national monitoring network.
- 🌐 Full API abstraction — Pagination, streaming, and response normalisation are handled automatically; you work with clean Python objects, not raw HTTP.
- 📦 Analysis-ready outputs — Observations return a
geopandas.GeoDataFrameby default; also available aspandas.DataFrameorGeoJSON. Samples return ageopandas.GeoDataFrameby default with option to fetch aspandas.DataFrame. No post-processing needed.
Discovery & filtering
- 🔎 Validated filters with fuzzy resolution — Mistyped or partial filter values are caught and corrected before any request is sent, with a ranked list of suggestions.
- ⚡ Preview before you download — Inspect the first page of results instantly to confirm your filters before committing to a full retrieval.
- 🗺️ Interactive spatial selector — Draw a bounding polygon on a live map widget directly in Jupyter; the geometry is applied as a filter automatically.
Developer experience
- 🧭 Sync and async clients —
EcoPlotsfor scripts and notebooks;AsyncEcoPlotsfor async/ASGI services and concurrent I/O pipelines. - 💾 Reproducible projects — Save and reload the full discovery state as a
.ecoprojfile for shareable, version-controllable workflows. - 🖼️ Notebook widgets — Built-in IGSN viewer and sample image browser for interactive exploration without leaving the notebook.
📖 Full documentation: https://terndata-ecoplots.readthedocs.io/en/latest/
Installation
pip install terndata.ecoplots
Supported Python: 3.10, 3.11, 3.12, 3.13
Key dependencies: aiohttp, geopandas, ipyleaflet, ipywidgets, rapidfuzz, orjson
Quick Start
Zero to data in three lines:
from terndata.ecoplots import EcoPlots
ec = EcoPlots()
ec.select(site_id="TCFTNS0002")
gdf = ec.get_data() # → GeoDataFrame, ready for analysis
See Modes for full workflow examples, or jump to the demo notebooks.
Modes
Observations (default)
Retrieve ecological observation data — site visits, feature types, and measured properties — across Australia's TERN monitoring network.
from terndata.ecoplots import EcoPlots
ec = EcoPlots() # mode="observations" by default
ec.select(dataset="TERN Surveillance",
site_id="TCFTNS0002")
ec.preview() # quick look (first page)
gdf = ec.get_data() # default → GeoDataFrame
df = ec.get_data(dformat="pd") # → pandas DataFrame
gjson = ec.get_data(dformat="geojson") # → GeoJSON (observations only)
Samples
Retrieve physical specimens — soil pit samples, plant voucher specimens, plant tissue samples, and more — with access to IGSN identifiers and sample images.
from terndata.ecoplots import EcoPlots
ec = EcoPlots(mode="samples")
ec.select(material_sample_type="Plant Voucher Specimen",
has_images=True)
gdf = ec.get_data() # default → GeoDataFrame
Samples mode includes two dedicated notebook widgets:
| Widget | Method | Description |
|---|---|---|
| IGSN viewer | ec.view_sample_igsn() |
Browse International Geo Sample Numbers linked to retrieved specimens |
| Sample image viewer | ec.view_sample_images() |
Preview photos associated with sample records inline in Jupyter |
Note: In samples mode the TERN Ecosystem Surveillance dataset is applied automatically and cannot be removed.
Async client (AsyncEcoPlots)
For async/ASGI services or concurrent I/O pipelines, use AsyncEcoPlots — it has the same interface as EcoPlots with await-able retrieval methods. Both modes, all filters, and all widgets are fully supported.
from terndata.ecoplots import AsyncEcoPlots
ec = AsyncEcoPlots()
ec.select(site_id="TCFTNS0002")
gdf = await ec.get_data() # non-blocking fetch
Interactive Widgets
Both modes provide notebook widgets for interactive data exploration:
| Widget | Mode | Method |
|---|---|---|
| Spatial selector | Both | ec.select_spatial() |
| IGSN viewer | Samples | ec.view_sample_igsn() |
| Sample image viewer | Samples | ec.view_sample_images() |
Demo Notebooks
| Mode | Notebook |
|---|---|
| Observations | examples/demo.ipynb |
| Samples | examples/demo_samples.ipynb |
Links
- 📚 Docs: https://terndata-ecoplots.readthedocs.io/en/latest/
- 🗺️ Workflow Reference: https://terndata-ecoplots.readthedocs.io/en/latest/workflows.html
- 🧭 EcoPlots Portal: https://ecoplots.tern.org.au
- 🧑💻 Source: https://github.com/ternaustralia/terndata.ecoplots
- 📦 PyPI: https://pypi.org/project/terndata.ecoplots/
Contributing
Contributions are welcome! Please open an issue first to discuss substantial changes before submitting a PR. For small bug fixes, a direct PR is fine.
Target branch: main
Development commands:
| Task | Command |
|---|---|
| Run tests | make test |
| Lint | make check-lint |
| Type check | make check-types |
| Lint + types | make check |
| Build docs | make doc |
| Build wheel | make build |
All checks are also available via tox — see tox.ini for environment definitions.
Support
- 🐛 Bug reports & feature requests: Open a GitHub issue
- 📧 Direct enquiries: esupport@tern.org.au
- 📚 Documentation: terndata-ecoplots.readthedocs.io
Citation
Terrestrial Ecosystem Research Network (2026). terndata.ecoplots: A Python package for accessing TERN EcoPlots data. https://pypi.org/project/terndata.ecoplots/
License
Licensed under the terms in LICENSE.
Copyright © 2025-2026 TDSA (TERN Data Services and Analytics).
Author: Avinash Chandra
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 terndata_ecoplots-1.0.0.tar.gz.
File metadata
- Download URL: terndata_ecoplots-1.0.0.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9003027bb82c4c9479486bd5c923a98b255f009fe8663bbc5adaff37f31f567
|
|
| MD5 |
bbeaf33a95eab55e9b0d642718791be6
|
|
| BLAKE2b-256 |
868d260a159b41e50125123e7be7500cfe0c40cca1bd2478c724902322dbd9a4
|
Provenance
The following attestation bundles were made for terndata_ecoplots-1.0.0.tar.gz:
Publisher:
publish.yml on ternaustralia/terndata.ecoplots
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
terndata_ecoplots-1.0.0.tar.gz -
Subject digest:
b9003027bb82c4c9479486bd5c923a98b255f009fe8663bbc5adaff37f31f567 - Sigstore transparency entry: 1439323763
- Sigstore integration time:
-
Permalink:
ternaustralia/terndata.ecoplots@a4fe516577d53c44ad763f74c385c71acdb4f78d -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/ternaustralia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a4fe516577d53c44ad763f74c385c71acdb4f78d -
Trigger Event:
release
-
Statement type:
File details
Details for the file terndata_ecoplots-1.0.0-py3-none-any.whl.
File metadata
- Download URL: terndata_ecoplots-1.0.0-py3-none-any.whl
- Upload date:
- Size: 131.8 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 |
cc279a405fd22984d2a905510f4c2a11be19d1839c3dda98e6335d5e3f8bf069
|
|
| MD5 |
762be7dbfabf1a65f453db0a46a407be
|
|
| BLAKE2b-256 |
d2d3b4eac5e898bdaa11b3dea5e9fffa6219b063adc85655ed3d3aead4d35658
|
Provenance
The following attestation bundles were made for terndata_ecoplots-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on ternaustralia/terndata.ecoplots
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
terndata_ecoplots-1.0.0-py3-none-any.whl -
Subject digest:
cc279a405fd22984d2a905510f4c2a11be19d1839c3dda98e6335d5e3f8bf069 - Sigstore transparency entry: 1439323777
- Sigstore integration time:
-
Permalink:
ternaustralia/terndata.ecoplots@a4fe516577d53c44ad763f74c385c71acdb4f78d -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/ternaustralia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a4fe516577d53c44ad763f74c385c71acdb4f78d -
Trigger Event:
release
-
Statement type: