Skip to main content

eidosxr

Python bindings and API client for EIDOS — the declarative visualisation framework for oceanic, geospatial and immersive data applications. Create, edit, render and manage EIDOS specifications from Python, and drive the EIDOS platform API.

This package supersedes the earlier oceanum.eidos / eidos-python package. Import from eidosxr instead of oceanum.eidos.

Installation

pip install eidosxr            # core: spec models + platform API client
pip install 'eidosxr[data]'    # + the data helpers (pandas, xarray, Datamesh, Altair)
pip install 'eidosxr[all]'     # everything (currently the same as [data])

Requires Python ≥ 3.10.

Install Pulls in What works
eidosxr pydantic, requests, jsonpatch, jinja2 the spec models (eidosxr.spec), Eidos (edit, diff/patch, html(), show()), the API client (eidosxr.api: EidosConnection, response models, exceptions)
eidosxr[data] + oceanum, pandas, geopandas, xarray, altair, numpy also EidosDatasource, EidosChart, isotime, OceanQL and the zarr consistency checks (check_store_consistency, compare_stores, EidosConnection.check_put_consistency)

The core install is small (about 16 MB of site-packages, against about 770 MB with [data]). Importing eidosxr never loads the data stack: the data helpers import it when called. Without the extra they raise an ImportError that says to pip install 'eidosxr[data]'.

Upgrading to 0.12.1. Up to 0.12.0, pip install eidosxr installed the data stack too. From 0.12.1 it is the data extra, so if you use EidosDatasource, EidosChart, isotime, OceanQL or the zarr consistency checks, install eidosxr[data] (or depend on it in your requirements). The schema and the public names are unchanged: from eidosxr import X and from eidosxr import * still work for every name exported before. The one exception is from eidosxr.spec import *, which no longer binds OceanQL; import it by name.

Package layout

  • eidosxr.spec — the EIDOS specification models: pydantic models generated from the EIDOS JSON schemas (world, plot, document and grid nodes, world layers, data, theme, …) plus the live Eidos wrapper class and the spec-side exceptions.
  • eidosxr.api — the EIDOS platform API client: EidosConnection, the response models, zarr consistency checks and the HTTP error hierarchy.

Everything public is also re-exported at the top level, so from eidosxr import Eidos, World, EidosConnection works.

Quickstart — build and display a spec

from eidosxr import Eidos, Document

spec = Eidos(
    id="demo",
    name="demo",
    description="I am an EIDOS spec",
    data=[],
    root=Document(id="doc-1", content="Hello EIDOS"),
)

spec.show()          # open in a browser via the hosted renderer
html = spec.html()   # or get the embeddable HTML (e.g. for notebooks)

The models validate on assignment — invalid edits raise EidosSpecError immediately:

spec.root.content = "Updated"        # fine
spec.root.nodeType = "not-a-node"    # raises EidosSpecError

An Eidos model tracks its own changes: spec.diff() returns the RFC-6902 JSON Patch since the last checkpoint, and spec.patch() returns it and advances the checkpoint. Eidos.from_dict(...) / Eidos.from_json(...) load existing specifications.

Top-level keys starting with x- hold your own metadata: Eidos keeps them (any JSON value) and writes them back out. Any other unknown top-level key is rejected. A spec used as a template can also declare parameters (TemplateParameter) for the user to fill in.

Data binding

Needs the data extra: pip install 'eidosxr[data]'.

EidosDatasource wraps your data for the spec's data block. It accepts a pandas DataFrame or an xarray Dataset (inline dataset), a geopandas GeoDataFrame (GeoJSON), or an Oceanum Datamesh Query (fetched server-side by the renderer):

import pandas as pd
from oceanum.datamesh import Query
from eidosxr import EidosDatasource

df = pd.DataFrame({"time": pd.date_range("2021-01-01", periods=3), "v": [3.1, 2.7, 4.2]})
inline = EidosDatasource("profile", df)   # dataType == "dataset"

remote = EidosDatasource(                 # dataType == "oceanql"
    "waves", Query(datasource="oceanum_wave_glob05_era5_v1_grid")
)

Datetime columns are serialised to ISO 8601 strings, which the renderer normalises back to times.

Platform API client

EidosConnection talks to the EIDOS platform (specification and template CRUD, JSON-Patch updates, zarr dataset and asset storage). It authenticates with a bearer token — an ek_ Oceanum API key or a Supabase user JWT — passed as token= or via the EIDOS_TOKEN environment variable.

from eidosxr.api import EidosConnection

conn = EidosConnection(token="ek_...")

record = conn.get_specification(spec_id)   # -> Specification (has .version)
spec = record.to_eidos()                   # -> live Eidos model
spec.root.title = "Updated"
conn.update_specification(spec_id, spec, if_match=record.version)

Failed requests raise typed exceptions from eidosxr.api — for example NotFound (404), PreconditionFailed (412, carries .current_version) or QuotaExceeded (402) — all subclasses of EidosApiError, which is itself an EidosError.

Regenerating the models (development)

The models in eidosxr/spec/ are generated from the EIDOS JSON schemas. Pass the schema version; the script reads that version's published path, https://schemas.oceanum.io/eidos/v0.12/:

pip install -e '.[development]'
bash autogen/gen_models.sh v0.12

To generate from schemas that are not published yet, give the local copy of that path as a second argument, e.g. from a checkout of the eidos monorepo:

bash autogen/gen_models.sh v0.12 ../eidos/packages/schemas/src/eidos

The script stops if the schemas are not the version asked for, if datamodel-codegen is not the pinned version, or if anything fails. datamodel-code-generator is pinned in the development extra: its output differs materially between versions, and current releases cannot process node/world.json. The script writes the spec tree only — eidosxr/__init__.py, eidosxr/api/__init__.py and eidosxr/version.py are hand-maintained. autogen/gen_init.py writes eidosxr/spec/__init__.py; it leaves the modules that need the data extra (oceanql.py) out of the star imports and resolves their names lazily instead. Run the tests afterwards; tests/test_nested_world.py guards against the generator dropping a nested world's view state.

Tests

pip install -e '.[all,test]'
pytest tests/

With only pip install -e '.[test]' (the core install) the data-helper tests are skipped; tests/test_core_install.py checks the core works without the data stack. CI runs both.

Licence

MIT — see LICENSE.

Metadata

Release files for eidosxr 0.12.3

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

Source distribution (sdist)

Source distribution for eidosxr 0.12.3
File Size Uploaded Provenance Actions
eidosxr-0.12.3.tar.gz 101.7 kB With provenance Details for eidosxr-0.12.3.tar.gz

Built distribution (wheel)

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

Total release size: 185.5 kB

Release files / eidosxr-0.12.3.tar.gz

Download URL eidosxr-0.12.3.tar.gz
Size 101.7 kB
Tags Source
SHA-256 checksum
How to use checksums
75dd89ffd35c8d11c97cedfad66bbc76f8d270b886518ed2e8e8e5ca188ec907
BLAKE2b-256 checksum
How to use checksums
115019e86832089676e9e0fddd73dd78b31d9c57b102410dce436619b4f9cd0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 17, 2026.

Transparency log

Release files / eidosxr-0.12.3-py3-none-any.whl

Download URL eidosxr-0.12.3-py3-none-any.whl
Size 83.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2f110f78f5c72578049367e98c815da27b0cee266a8bcbb627bd07ae1c46dcc
BLAKE2b-256 checksum
How to use checksums
a3a5dd94982f24e13d324a375013ef80d8ffd0f42f99ec9b6c68aff0a25e00f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 17, 2026.

Transparency log

Security for eidosxr 0.12.3

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 eidosxr-0.12.3.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 Oct 17, 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.

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