Skip to main content

aiogeodrops

Async Python client for GeoDrops soil-probe readings.

GeoDrops publishes every probe's readings to a public Google BigQuery table. This library queries it over BigQuery's REST API with a Google service account. It is built on aiohttp and PyJWT only (no Google Cloud SDK, no gRPC), takes your aiohttp.ClientSession, and is fully typed.

It is the library behind the GeoDrops Home Assistant integration.

Install

pip install aiogeodrops

Prerequisites

A Google Cloud project of your own (queries run and are billed there, well within BigQuery's free tier for a handful of probes), with the BigQuery API enabled, and a service account that has BigQuery Job User on that project. Download a JSON key for the service account.

Usage

import asyncio
from pathlib import Path

import aiohttp

from aiogeodrops import GeoDropsClient


async def main() -> None:
    key = Path("service-account.json").read_text()
    async with aiohttp.ClientSession() as session:
        client = GeoDropsClient(session, "my-gcp-project", key)

        await client.validate_access()

        # Find a probe's device id from the serial shown in the GeoDrops app.
        reading = await client.lookup_serial("AAA111", lookback_hours=12)
        if reading is None:
            print("No reading in the last 12 hours")
            return

        latest = await client.fetch_latest([reading.device_id], lookback_hours=12)
        probe = latest[reading.device_id]
        print(probe.moisture_pct, probe.temp_surface, probe.read_at)


asyncio.run(main())

fetch_latest makes one query for all the device ids you pass. Each query gives up after 60 seconds (query_timeout= to change).

When GeoDrops changes its table

GeoDrops' table is theirs to change, and columns have been renamed or dropped before. Before querying, the client reads which columns exist (a free metadata call, repeated at most every 6 hours) and selects only those:

  • A missing column leaves the reading fields it fed as None (or UNCLASSIFIED). client.missing_columns lists them, and one warning is logged.
  • If a query still names an unknown column, the columns are re-read and the query retried once.
  • GeoDropsSchemaError is raised only when a column the query can't run without is gone: deviceId, date, createdAtOrigin, and mfgSn for lookup_serial.

await client.table_columns() lists every column GeoDrops publishes.

Errors

All errors derive from GeoDropsError:

Exception Meaning What to do
GeoDropsCredentialsError The key isn't a usable service-account key Fix the key; raised by the constructor
GeoDropsAuthError Google rejected the key (deleted, revoked, account disabled) Create a new key
GeoDropsAccessDeniedError 403: missing BigQuery Job User role, or BigQuery API not enabled Fix it in Google Cloud; then retry
GeoDropsSchemaError GeoDrops' table lost a column the query can't run without Update aiogeodrops
GeoDropsQueryError BigQuery rejected the query (parent of GeoDropsAccessDeniedError and GeoDropsSchemaError) Check the project id
GeoDropsConnectionError Network error, timeout, Google outage, rate or quota limit Retry later

Development

pip install -e ".[dev]"
ruff check . && ruff format --check .
mypy
pytest --cov=aiogeodrops

Releases are published to PyPI by GitHub Actions when a GitHub release is published, using PyPI trusted publishing (no stored token) with attestations.

License

MIT

Metadata

Release files for aiogeodrops 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiogeodrops 0.3.0
File Size Uploaded Provenance
aiogeodrops-0.3.0.tar.gz 25.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aiogeodrops 0.3.0
File Interpreter ABI Platform
aiogeodrops-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.9 kB

Release files / aiogeodrops-0.3.0.tar.gz

Download URL aiogeodrops-0.3.0.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2f69d0407f80c70333398af30a7f16a2cdf559bc25b5e67f5991a14a2beff37b
BLAKE2b-256 checksum
How to use checksums
01dea50f5b1cd4a0caa53a7df3c678a1006990192b1a4e50d7bff3bb58ac43be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / aiogeodrops-0.3.0-py3-none-any.whl

Download URL aiogeodrops-0.3.0-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ee8e974f714c58173eee9ecd2b1fa434a822a075b6598f17abe3b9c908a350b
BLAKE2b-256 checksum
How to use checksums
3e90671953ffcc9662dd209f03759b2ae10c0b300c4d283debf544e935164541
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Security for aiogeodrops 0.3.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aiogeodrops-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page