Python SDK for agrodigital.io.
Project description
AgroDigital Python SDK
A modern, easy-to-use Python SDK for interacting with the agrodigital.io API. This library provides a high-level interface to manage agricultural entities, IoT data, meteorological stations, and satellite imagery analysis.
Features
- Entity Management: CRUD operations for Farms, Fields, Polygons, and Crops.
- Monitoring & Data: Specialized access to Raster imagery, indexes, and Google Earth Engine clusters.
- IoT & Meteo: Seamless integration with IoT stations and meteorological data.
- Operations Logs: Track sowing, applications, and logs.
- Scouting: Manage bugs, weeds, and diseases via waypoints.
- Object-Oriented: All API responses are converted into Python objects with dot-notation access.
Installation
You can install the SDK via pip:
pip install agrodigital_io
Or using poetry:
poetry add agrodigital_io
Quick Start
Authentication
To begin, initialize the AgroDigitalClient using either your API token or your username and password.
from agrodigital_io import AgroDigitalClient
# Option 1: Using an API Token
client = AgroDigitalClient(token="your_api_token_here")
# Option 2: Using Credentials
client = AgroDigitalClient(username="your_username", password="your_password")
Basic Operations
List all farms
farms = client.farms.list()
for farm in farms:
print(f"Farm: {farm.name} (ID: {farm.id})")
Get field data
field = client.fields.retrieve(id=123)
print(f"Field name: {field.name}")
print(f"Associated crop: {field.crop.name}") # Nested objects supported
Fetch IoT Data
# Get data from a specific station between dates
data = client.iot_data.list_data(
station_id=45,
from_date="2023-01-01",
to_date="2023-01-07",
variables=["temperature", "humidity"]
)
Advanced Usage
Raster and Imagery
Access satellite imagery metadata and available dates for specific polygons.
dates = client.rasters.available_dates()
print(f"Available imagery dates: {dates}")
Cluster Retrieval
Fetch Google Earth Engine or local clusters for a specific polygon and date range.
clusters = client.cluster.ee_retrieve(
from_date="2023-01-01",
to_date="2023-12-31",
polygon_id="poly_88",
n_clusters=5
)
Error Handling
The SDK raises AgroDigitalError for API-related issues, including connection timeouts and non-200 status codes.
from agrodigital_io import AgroDigitalError
try:
client.fields.retrieve(999999)
except AgroDigitalError as e:
print(f"Error: {e.message}")
print(f"Status Code: {e.status_code}")
Requirements
- Python >= 3.10
requestslibrary
License
This project is licensed under the MIT License. See the LICENSE file for details.
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 agrodigital_io-0.1.1.tar.gz.
File metadata
- Download URL: agrodigital_io-0.1.1.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17e64f437ec89e6edf7afa506352891a6e9b8cd73f2505faacca32420b09b9f0
|
|
| MD5 |
43d3879d73e6d954ead288ecdc70b051
|
|
| BLAKE2b-256 |
82002cf9f995a55a77f8f917d10e71f91346caf3b27304b023bec03005b9a1eb
|
Provenance
The following attestation bundles were made for agrodigital_io-0.1.1.tar.gz:
Publisher:
python-publish.yml on agro-digital/agrodigital-io-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agrodigital_io-0.1.1.tar.gz -
Subject digest:
17e64f437ec89e6edf7afa506352891a6e9b8cd73f2505faacca32420b09b9f0 - Sigstore transparency entry: 817274179
- Sigstore integration time:
-
Permalink:
agro-digital/agrodigital-io-py@82cde439201ede8f83667562439829bdb8da6c97 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/agro-digital
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@82cde439201ede8f83667562439829bdb8da6c97 -
Trigger Event:
release
-
Statement type:
File details
Details for the file agrodigital_io-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agrodigital_io-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e834a7456fea56cc43fe6e120218d1d50cc9ac234f72faa2ea1cf5275125787
|
|
| MD5 |
c35f63bbfac0ec9cb9dcf6faf5d8014d
|
|
| BLAKE2b-256 |
a6ce3e1d281513a93aef8c68941108075df69483b38fa391d3577d258a9430a7
|
Provenance
The following attestation bundles were made for agrodigital_io-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on agro-digital/agrodigital-io-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agrodigital_io-0.1.1-py3-none-any.whl -
Subject digest:
4e834a7456fea56cc43fe6e120218d1d50cc9ac234f72faa2ea1cf5275125787 - Sigstore transparency entry: 817274258
- Sigstore integration time:
-
Permalink:
agro-digital/agrodigital-io-py@82cde439201ede8f83667562439829bdb8da6c97 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/agro-digital
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@82cde439201ede8f83667562439829bdb8da6c97 -
Trigger Event:
release
-
Statement type: