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.4.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.4.0
File Size Uploaded Provenance
aiogeodrops-0.4.0.tar.gz 26.8 kB With provenance Details

Built distribution (wheel)

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

Total release size: 43.8 kB

Release files / aiogeodrops-0.4.0.tar.gz

Download URL aiogeodrops-0.4.0.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6fa5baa5153a93fcebf910b18332c1ec3beb94ab38a33ed9c5e25deed299cd73
BLAKE2b-256 checksum
How to use checksums
64d80db6452c0188ece2d1683d92f8bdb97a56114b675c31c5a38d17246ba448
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.4.0-py3-none-any.whl

Download URL aiogeodrops-0.4.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8da8846eaba6692f0dcbfaaf8bbe9ba8a4e3f950005798825bd977a5d9aeb9f
BLAKE2b-256 checksum
How to use checksums
fbe0c1010fd96afbfcfeb487104e9fcecf1526977fbac662b80cdf8d50844dec
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.4.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.4.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