Skip to main content

Renovara SQL API — Python client

Read-only SQL over Australian National Electricity Market (NEM) and east coast gas market data from AEMO, from your own code. The SQL is DuckDB's.

pip install renovara-sql

See what the data is — no credentials needed

from renovara_sql import Client

public = Client("https://sql.api.renovara.co/v1")
print(public.guide()[:2000])       # which table answers what, and the traps
for t in public.tables():          # every table, one line each
    print(t["table"], "-", t["description"][:80])
print(public.table("silver_dispatchis_reports_dispatch_price")["columns"][:5])

Credentials

Your Renovara credentials page gives you a file:

{
  "api_url": "https://sql.api.renovara.co/v1/",
  "token_url": "https://auth.api.renovara.co/oauth2/token",
  "client_id": "…",
  "client_secret": "…",
  "scope": "renovara-sql/query"
}

Keep it private: anyone holding it can query as your organisation. It is an OAuth client-credentials pair, exchanged for an access token that lasts an hour; the client keeps the token for the hour and renews it for you.

Run queries

from renovara_sql import Client

client = Client.from_file("~/.config/renovara-sql/acme.json")
result = client.query("""
    SELECT REGIONID, round(avg(RRP), 2) AS avg_price
    FROM silver_dispatchis_reports_dispatch_price
    WHERE SETTLEMENTDATE >= current_timestamp + INTERVAL 10 HOUR - INTERVAL 7 DAY
      AND INTERVENTION = 0
    GROUP BY 1 ORDER BY 1
""")
print(result.column_names, result.rows)
print(result.usage)                 # your plan, query time used, statements today
frame = result.to_pandas()          # needs pandas; pyarrow for exact types
result.download("prices.parquet")   # the full result, any size

python quickstart.py <credentials file> runs a short tour.

What to know

  • DuckDB SQL, one SELECT per request (or EXPLAIN SELECT … for the plan). client.guide() lists the differences from Databricks SQL. Tables answer to their bare names or to external_data.nemweb.<table>.
  • Times: SETTLEMENTDATE and the other NEM timestamps are AEST market time (UTC+10, no daylight saving) already. Don't shift them. "Now" in market time is current_timestamp + INTERVAL 10 HOUR.
  • Long queries: query() returns when the query finishes, polling if the server needs more than ~20 s. A statement stops at 300 s. For control, use submit(sql), status(statement_id) and cancel(statement_id).
  • Results: up to 10,000 rows come back inline as result.rows; every result is also a Parquet file at result.parquet_url for an hour. Over 5,000,000 rows a statement is refused: aggregate in SQL. Statements and results last 24 hours.
  • Retries are safe: query() sends an idempotency key, so a retry never runs a statement twice.
  • Errors raise QueryFailed (a statement that ran and failed: code is QUERY_REJECTED, SQL_ERROR, QUERY_TIMEOUT, RESULT_TOO_LARGE or CANCELLED) or RenovaraError (a refused request, e.g. DAILY_LIMIT, ALLOWANCE_USED). Each has a docs_url.

Without the client

TOKEN=$(curl -s -u "$CLIENT_ID:$CLIENT_SECRET" -d grant_type=client_credentials \
  -d scope=renovara-sql/query "$TOKEN_URL" | jq -r .access_token)
# Keep $TOKEN for its hour: each one issued is billed, so not one per query.

curl -s -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"sql": "SELECT count(*) FROM silver_dispatchis_reports_dispatch_price", "wait_seconds": 20}' \
  "${API_URL}statements"
# -> {"statement_id": "…", "state": "SUCCEEDED", "result": {"columns": …, "rows": …}}
#    or "state": "RUNNING": then GET ${API_URL}statements/<statement_id> until it isn't

The API describes itself: GET ${API_URL} and GET ${API_URL}openapi.json.

Metadata

Release files for renovara-sql 0.2.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 renovara-sql 0.2.0
File Size Uploaded Provenance Actions
renovara_sql-0.2.0.tar.gz 10.5 kB With provenance Details for renovara_sql-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for renovara-sql 0.2.0
File Interpreter ABI Platform Actions
renovara_sql-0.2.0-py3-none-any.whl Python 3 none any Details for renovara_sql-0.2.0-py3-none-any.whl

Total release size: 19.1 kB

Release files / renovara_sql-0.2.0.tar.gz

Download URL renovara_sql-0.2.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
04880364174ff7a422c38005d3717ed89a141bdc7e0a209cc5758b75ad0ed3b0
BLAKE2b-256 checksum
How to use checksums
db023b1bdc9fe83a94bfe7ccd3bc19dd06cf4310161d072229c0dba082105b98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Release files / renovara_sql-0.2.0-py3-none-any.whl

Download URL renovara_sql-0.2.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3f9869b1862b9a575820eac76d266bf07897e82dc06587ba86b719778f08047
BLAKE2b-256 checksum
How to use checksums
c880916964a15f26de334f4b6e862c6653113b5bee32927c337f50ffe95528dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Security for renovara-sql 0.2.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for renovara_sql-0.2.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 Nov 11, 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full 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