Ceres
Farm to market to plate to policy
Country-commodity food-system data and economist-first briefs. Four engines spanning the full value chain: farm (production, yields, inputs), markets (commodity prices, trade flows, stocks), consumption and nutrition (diet composition, food security, stunting), and policy/fiscal (subsidies, tariffs, public expenditure). FAO, AMIS, USDA, IFPRI data. Default port 8008.
What this observatory tracks
Farm engine
Crop production volumes, yields per hectare, arable land, fertilizer use, irrigation coverage. The physical supply side of the global food system, structured for cross-country comparison.
Markets engine
Commodity spot and futures prices, trade flows by product, import dependency ratios, stock-to-use ratios. Price transmission from global benchmarks to domestic retail.
Consumption and nutrition engine
Dietary energy supply, protein availability, prevalence of undernourishment, stunting and wasting rates, food price inflation. The demand and welfare side of the value chain.
Policy and fiscal engine
Agricultural subsidies, tariff schedules, public spending on agriculture as share of GDP, food safety net programs. The institutional layer that shapes farm incentives and consumer access.
4 engines, 71 collectors
Each engine groups collectors by economic domain. Collectors pull from FAO, AMIS, USDA, IFPRI, and other public sources on staggered UTC schedules. All data lands in a single SQLite warehouse with consistent schema.
Production surface
FastAPI and Starlette middleware: gzip, optional CORS, security headers, X-Request-ID on every response, optional JSON log lines via LOG_JSON. Readiness runs SELECT 1 against SQLite. Optional GET /metrics exposes ceres_http_* counters and latency histograms.
- Warehouse: WAL SQLite, tuned page cache and mmap, optimize on shutdown.
- Ingestion: httpx async client, APScheduler for staggered UTC collection, openpyxl for Excel sources.
- OpenAPI: /docs and /redoc on the running service.
Route map (read-only data)
All under /api/data/. Query parameters support filtering, year windows, pagination, and multi-series panels. Admin routes under /api/admin/ require X-Admin-Key when configured.
What operators should know
Seventy-one collectors across four engines. Some sources (FAO bulk, USDA PSD) deliver large payloads. The client spaces requests to respect rate limits. For production, set a real admin secret, decide whether metrics scrape is internal-only, and back up the SQLite file with a quiet window or the SQLite backup API.
The exhaustive manual (schema DDL, every query parameter, troubleshooting, deployment notes) lives in the repo:
Start the observatory
From the ceres/ directory:
Integration tests against live APIs:
Then open http://127.0.0.1:8008/docs or call /api/data/sources.