Skip to main content

insseption

JSON API + Python client for INSSE TEMPO-Online (Romania’s National Institute of Statistics).

  • HTTP JSON API — open /api/v1/... in a browser; responses are indented application/json
  • Python package — from insseption import Client
  • UI — chat-first front page at / (Ask TEMPO agent); JSON discovery at /api

Production: https://insse.csaladen.es

INSSE reuse terms

Python client

Published on PyPI:

pip install insseption

From source / GitHub (optional):

pip install "git+https://github.com/csaladenes/insseption.git"
from insseption import Client

with Client() as c:                       # https://insse.csaladen.es/api/v1
    print(c.health())
    print(c.context(lang="en")["nodes"][:3])
    meta = c.matrix("POP105A", lang="en")
    data = c.query("POP105A", lang="en")  # default totals / latest year
    print(data["columns"], data["row_count"])

Point at a local server:

Client("http://127.0.0.1:8787/api/v1")

CLI:

insseption --base-url http://127.0.0.1:8787/api/v1 health
insseption --base-url http://127.0.0.1:8787/api/v1 query POP105A

JSON API (/api/v1)

Method Path Returns
GET /api Service catalog (JSON)
GET /api/v1 Endpoint list
GET /api/v1/health {ok, upstream_ok, ...}
GET /api/v1/meta Service metadata
GET /api/v1/context?lang=en Domain tree roots
GET /api/v1/context/{code} Children
GET /api/v1/matrices/{code} Dimensions / options
GET /api/v1/matrices/{code}/query Rows (default selection)
POST /api/v1/matrices/{code}/query Rows ({lang, selections})
GET /api/v1/news Recent updates
POST /api/v1/translate Label translation

Interactive docs: /docs · OpenAPI: /openapi.json

Example in browser:

https://insse.csaladen.es/api/v1/matrices/POP105A/query?lang=en

POST body:

{
  "lang": "en",
  "selections": { "5": [4931], "1": [1] }
}

Run the API locally

python3.11 -m venv .venv && source .venv/bin/activate
pip install -e ".[server]"
uvicorn insseption.main:app --host 127.0.0.1 --port 8787

Deploy (Docker / Traefik)

Example host layout (adjust to your stack):

  • App path: ./insseption/ next to your compose file
  • Service: insseption (+ optional insseption-agent)
  • Traefik host rule: insse.csaladen.es → :8787
  • Networks: public edge + internal
# on the host
# sync ./insseption (rsync --exclude .env) and ensure ./insseption/.env (OPENROUTER_API_KEY)
docker-compose up -d --build --no-deps insseption
curl -sS https://insse.csaladen.es/api/v1/health

Guide: https://insse.csaladen.es/docs

Chat agent (separate container)

NL agent in ./agent (OpenRouter → TEMPO via the JSON API). The agent container stays on the internal Docker network; the API reverse-proxies /agent/*. The chat UI is the site front page at /.

URL Purpose
https://insse.csaladen.es/ Ask TEMPO (front page)
https://insse.csaladen.es/agent/health Agent health
POST https://insse.csaladen.es/agent/api/query { "query": "...", "generate_chart": true }
docker-compose up -d --build --no-deps insseption insseption-agent
curl -sS https://insse.csaladen.es/agent/health

Host smoke harness

# API + docs + chat home + agent against production (or set INSSEPTION_HOST)
python3 scripts/harness.py
# lighter API-only check:
INSSEPTION_BASE=https://insse.csaladen.es/api/v1 python3 scripts/smoke.py

License

MIT — © Dénes Csala (GitHub). Data remains subject to INSSE reuse terms.

Metadata

Release files for insseption 0.1.1

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

Source distribution (sdist)

Source distribution for insseption 0.1.1
File Size Uploaded Provenance
insseption-0.1.1.tar.gz 37.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 78.2 kB

Release files / insseption-0.1.1.tar.gz

Download URL insseption-0.1.1.tar.gz
Size 37.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f52ca620219153eab52b71df7e56b247b281496aaaa671607c9398fb49b58782
BLAKE2b-256 checksum
How to use checksums
acef03b848e41a5d5e5cd2ecbb6b1764520c4379d365e3d515e707851c31eefc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / insseption-0.1.1-py3-none-any.whl

Download URL insseption-0.1.1-py3-none-any.whl
Size 40.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9de7c438cceb100c6b79fe269605c2bf913bf57ac04bae16dc511aa3798b9aaa
BLAKE2b-256 checksum
How to use checksums
ed9d3ad68818f323afc9bd5e97d7d4b6df4093d17978a565953a8b49598bd9fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Security for insseption 0.1.1

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.1 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