Skip to main content

jiskta-python

Python SDK for the Jiskta Climate Data API — query historical air quality data (NO₂, PM2.5, PM10, O₃) and ERA5 meteorological data via a simple Python interface.

Install

pip install jiskta

Pandas is optional but recommended:

pip install "jiskta[pandas]"

Quick start

from jiskta import JisktaClient

client = JisktaClient(api_key="sk_live_...")

# Daily NO₂ and PM2.5 over Paris in 2023
df = client.query(
    lat=(48.7, 49.0),
    lon=(2.2, 2.5),
    start="2023-01",
    end="2023-12",
    variables=["no2", "pm2p5"],
    aggregate="daily",
)
print(df.head())
#         lat    lon        date  no2_mean  pm2p5_mean
# 0  48.7500  2.250  2023-01-01     12.34        8.21
# ...

All parameters

df = client.query(
    lat=(lat_min, lat_max),      # bounding box
    lon=(lon_min, lon_max),
    start="YYYY-MM-DD",          # or "YYYY-MM"
    end="YYYY-MM-DD",
    variables=["no2"],          # no2 | pm2p5 | pm10 | o3
    aggregate="daily",           # hourly | daily | monthly | annual
                                 # area_hourly | area_daily | area_monthly
                                 # diurnal | exceedance | percentile
    threshold=40.0,              # µg/m³  (exceedance mode)
    percentile=95,               # 0-100  (percentile mode)
)

Summary statistics (no DataFrame)

result = client.stats(
    lat=(48.7, 49.0),
    lon=(2.2, 2.5),
    start="2023-01",
    end="2023-01",
    variables=["no2"],
)
print(result["output"])

Error handling

from jiskta import JisktaClient, AuthError, InsufficientCreditsError, RateLimitError, JisktaError

try:
    df = client.query(...)
except AuthError:
    print("Invalid API key")
except InsufficientCreditsError:
    print("Buy more credits at https://jiskta.com/pricing")
except RateLimitError:
    print("Server busy, retry later")
except JisktaError as e:
    print(f"API error {e.status_code}: {e}")

Named area queries

Skip lat/lon by passing a named region:

df = client.query(
    area="paris",
    start="2023-01",
    end="2023-12",
    variables=["no2"],
    aggregate="daily",
)

result = client.stats(area="belgium", start="2023-01", end="2023-12")

Supported names depend on the API (e.g. "paris", "france", "belgium").

New aggregates

# Statistical aggregates
df = client.query(..., aggregate="max")       # daily/monthly max
df = client.query(..., aggregate="min")       # daily/monthly min
df = client.query(..., aggregate="stddev")    # standard deviation
df = client.query(..., aggregate="cumulative")  # running total (e.g. precipitation)

# Analytical aggregates
df = client.query(..., aggregate="seasonal")  # DJF/MAM/JJA/SON means
df = client.query(..., aggregate="trend")     # linear trend per grid cell

Wind variables

wind_speed and wind_dir are derived ERA5 variables (computed from u10/v10):

df = client.query(
    lat=(48.7, 49.0), lon=(2.2, 2.5),
    start="2023-01", end="2023-12",
    variables=["wind_speed", "wind_dir"],
    aggregate="daily",
)

Polygon-masked queries

Pass any GeoJSON Polygon or MultiPolygon geometry to restrict results to cells whose centres fall inside the polygon:

mask = {
    "type": "Polygon",
    "coordinates": [[[2.2, 48.7], [2.5, 48.7], [2.5, 49.0], [2.2, 49.0], [2.2, 48.7]]],
}

df = client.query_with_mask(
    lat_min=48.7, lat_max=49.0,
    lon_min=2.2, lon_max=2.5,
    start="2023-01",
    end="2023-12",
    variables=["no2"],
    aggregate="daily",
    mask=mask,
)

Advanced options

df = client.query(
    lat=(48.7, 49.0), lon=(2.2, 2.5),
    start="2023-01", end="2023-12",
    variables=["no2"],
    sort_by="no2_mean",       # sort CSV output by column
    sort_dir="desc",          # "asc" or "desc"
    unit="ppb",               # convert output units
    round=2,                  # decimal places
    dry_run=True,             # cost estimate only — no query executed
    missing_null=True,        # empty string for missing cells
    include_polygon=True,     # include area_polygon GeoJSON in raw response
)

License

MIT

Metadata

Release files for jiskta 0.5.2

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

Source distribution (sdist)

Source distribution for jiskta 0.5.2
File Size Uploaded Provenance
jiskta-0.5.2.tar.gz 16.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 31.0 kB

Release files / jiskta-0.5.2.tar.gz

Download URL jiskta-0.5.2.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a33760c3b5a13480b7986c67548df1fc2e1b622feebbff95acc47730ac5b7bb9
BLAKE2b-256 checksum
How to use checksums
fe3bff37114ff8f8f155c3e2b5fe0ff71783cbe410c5e5a5e59cccfabafb23cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / jiskta-0.5.2-py3-none-any.whl

Download URL jiskta-0.5.2-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a0e60073c53ab8444f676d5ee616f9bcfe84c8709c758585d1d3022dda0d29f
BLAKE2b-256 checksum
How to use checksums
bf32ee1779e2c83c2118ef40b98f0d85293a0f7e1e38ea9c11d1a57c93eb980c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for jiskta 0.5.2

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.

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