Skip to main content

silo

Cached SILO daily climate for Australia — fetch once per grid point, never twice. Every daily observation this machine ever fetches lands in one SQLite store keyed by SILO's native 0.05° (~5 km) grid, so repeat requests, nearby farms in the same cell, and extended date ranges all reuse the same rows. Part of the Borevitz Lab ecosystem.

How it works

{data_root}/silo_store/
└── silo.db
    ├── observations(point, date, variable, value)   # every value ever fetched
    └── coverage(point, start, end)                  # which date spans are populated
  • Any coordinate snaps deterministically to its nearest SILO grid point (~5 km cells — the resolution SILO interpolates at anyway).
  • Store.get_df(lat, lon, start, end) diffs the requested range against the coverage ledger and fetches only the missing spans from the DataDrill endpoint, then reads the range.
  • Coverage records only what SILO actually returned — if the record lags behind a requested recent date, the tail stays uncovered and is re-requested next time.
  • Writes are transactional (SQLite/WAL): a crash mid-fetch leaves the span unrecorded, and the next run re-fetches it.

Usage

The core API is troi-agnostic — a coordinate and dates:

from datetime import date
from pysilo.store import Store

store = Store()   # email from ~/.config/Troi.json, or pass email=...

df = store.get_df(-33.516, 148.373, date(2023, 1, 1), date(2023, 12, 31))
#    one row per day: date, daily_rain, max_temp, min_temp, radiation,
#    vp, et_short_crop, ... (18 variables)

store.fill(-33.516, 148.373, date(2023, 1, 1), date(2023, 12, 31))  # → 0: already local

Pipelines that speak the shared troi.troi.Troi use the adapters (evaluated at the bbox centre):

df = store.get_df_troi(troi)

download_silo(troi) remains as a thin wrapper returning the classic YYYY-MM-DD-columned frame.

SILO requires a registration email (sent as the API username) — set email in ~/.config/Troi.json, TROI_EMAIL, or pass email= per call.

Performance

Live measurements against SILO — one grid point, all 18 variables:

Scenario Fetched Time
Cold fill — one year (365 days) 365 days 0.9 s
Same request again nothing 0.0 s
Nearby farm, same ~5 km cell nothing 0.0 s
Date range extended +6 months 182 days — the extension only 2.8 s
Read cached year (365 × 18) — 0.02 s

Store footprint: ~0.5 MB per point-year across all variables. Absolute times vary with network and SILO load; the zeros are the point — they are ledger lookups, no network involved.

Install

pip

pip install git+https://github.com/thestochasticman/pysilo.git

Dependencies (the troi core included, pulled from GitHub) are declared in pyproject.toml and installed automatically.

From source

git clone https://github.com/thestochasticman/pysilo.git
cd pysilo
pip install -e .

Package design (shared across the lab's packages — no inheritance, composition only):

  • Troi (from troi) — identity: what region, what dates.
  • SILO (pysilo.silo) — config: endpoint, comment codes, variables.
  • Paths (pysilo.paths) — derived location of the store for a given Config.
  • grid — the fixed 0.05° grid (pure, offline-testable math).
  • Store (pysilo.store) — ties them together.

Test

# offline (pure math + synthetic store):
python pysilo/grid.py     # True
python pysilo/paths.py    # True
python pysilo/store.py    # True

# live (small real fetches from SILO, incl. dedup assertions):
python pysilo/download_silo.py  # True

Metadata

Release files for pysilo-store 0.1.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 pysilo-store 0.1.0
File Size Uploaded Provenance Actions
pysilo_store-0.1.0.tar.gz 12.1 kB Without provenance Details for pysilo_store-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysilo-store 0.1.0
File Interpreter ABI Platform Actions
pysilo_store-0.1.0-py3-none-any.whl Python 3 none any Details for pysilo_store-0.1.0-py3-none-any.whl

Total release size: 24.6 kB

Release files / pysilo_store-0.1.0.tar.gz

Download URL pysilo_store-0.1.0.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a15ef55cfdabb8f71bd22bbd6d2e403ff15e483d8eb742e4959f3f2525f219a7
BLAKE2b-256 checksum
How to use checksums
46313b0c63631db1f8554317f045ea79262665f7099be035db3e9dffe992db64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / pysilo_store-0.1.0-py3-none-any.whl

Download URL pysilo_store-0.1.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1519c860e32b184af082e2a7837127470d907fa383f0b1f23b2756b3019bcf56
BLAKE2b-256 checksum
How to use checksums
30d53cf9a8a893c5c365b7f5d3bf9073f5b0a4fa593583a098f6793042c0db79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for pysilo-store 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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