Skip to main content

PyPI Python versions Docs DOI

Structured data format (sdata)

Design goals & status

sdata is an open, self-describing data format for open-science projects. The table below is an honest status of the original design goals (triaged in RFC 0008) — implemented, partial, on the roadmap, or an explicit non-goal.

Goal Status Notes
Open, self-describing data implemented metadata embedded in every format
Platform independent, simple object model implemented pure Python / numpy / pandas
Standard metadata formats (key/value, JSON-LD, …) implemented Metadata, QUDT/BFO/PROV/CSVW/DID/VC
Physical units + conversion implemented sdata.units (RFC 0006)
Standard dataset formats — HDF5, CSV, Parquet, Arrow, Data Package implemented HDF5 via sdata[hdf]
(De-)serialization of data + metadata implemented lossless round-trips
Data format versions implemented _sdata_format_version + migration (RFC 0010)
Project standards (e.g. tensile test) partial schema templates (MetadataSchema/TableSchema)
Series partial as a one-column table
Hierarchical structure / nested groups partial DataFrameGroup (flat) + parent/project relations
Transparent compression partial Parquet-internal (zstd); zlib is a non-goal for the store (speed)
Standard dataset formats — netCDF roadmap not implemented
Dataset types — datacubes roadmap not implemented
Optional encryption (gpg, …) non-goal encrypt blobs/filesystem out of band
posix-path syntax, change management, tensor-library interop, SWMR non-goal not planned; revisit on demand

Machine-readable metadata is the backbone (see below); the optional semantic backends degrade gracefully to pure Python.

Quickstart

import pandas as pd
from sdata.sclass.dataframe import DataFrame

df = pd.DataFrame({"force": [1.0, 2.0, 3.0]})
data = DataFrame(df=df, name="specimen_01", description="a tension test")
data.metadata.add("max_force", 12.5, unit="kN", dtype="float",
                  description="max force", ontology="bfo:Quality")

print(data.metadata.df[["value", "unit", "dtype", "ontology"]])
                                          value unit  dtype     ontology
key
_sdata_name                         specimen_01    -    str
_sdata_sname    DataFrame__specimen_01__3003...    -    str
...
max_force                                  12.5   kN  float  bfo:Quality

Every object has a deterministic, content-addressable identity (SUUID), a set of reserved _sdata_* attributes (name, sname, suuid, class, ctime, parent, project, topology class) and freely extensible, fully-described user attributes.

Machine-readable metadata (JSON-LD / Linked Data)

The metadata is the backbone of the data description: it lives next to every data blob and fully qualifies the data — units (QUDT/UCUM), ontology classes (BFO), provenance (PROV/DCAT), tabular columns (CSVW) and identity (DID).

# self-describing JSON-LD (qudt:Quantity units, BFO @type, did:suuid @id, csvw columns)
doc = data.to_jsonld()

# RDF/Turtle (uses rdflib if installed, otherwise returns the JSON-LD)
print(data.to_turtle())

# write the data + a sidecar <sname>.meta.jsonld right next to it
data.to_json("specimen_01.sjson", sidecar=True)

# validate / auto-complete against a schema template
from sdata.schema import MetadataSchema, AttrSpec
schema = MetadataSchema("TensileTest", [
    AttrSpec("max_force", dtype="float", unit="kN", required=True, ontology="bfo:Quality"),
])
report = data.metadata.validate(schema)      # ValidationReport (truthy if ok)

# sign the metadata as a W3C Verifiable Credential (pure-Python Ed25519)
from sdata.did import keys, pub_from_priv_jwk
priv = keys.gen_ed25519_jwk()
vc = data.metadata.to_verifiable_credential("did:example:issuer", priv)
subject = data.metadata.from_verifiable_credential(vc, pub_from_priv_jwk(priv))

# interactive: attribute autocomplete + rich Jupyter display
data.metadata.a.max_force        # -> Attribute; tab-completion in Jupyter
data.metadata                    # -> _repr_html_ table

Resulting JSON-LD for max_force (excerpt):

{
  "@id": "did:suuid:DataFrame__specimen_01__3003...:sdata",
  "@type": ["sdata:DataFrame", "bfo:BFO_0000004"],
  "name": "specimen_01",
  "sdata:max_force": {
    "@type": ["qudt:Quantity", "bfo:Quality"],
    "value": {"@value": 12.5, "@type": "xsd:double"},
    "unitRef": "unit:KiloN", "symbol": "kN"
  },
  "columns": [{"name": "force", "datatype": "xsd:double"}]
}

The optional semantic backends degrade gracefully to pure Python (no hard dependency): pip install "sdata[rdf]" (rdflib), sdata[units] (pint), sdata[schema] (jsonschema). Core install needs only numpy, pandas, suuid.

Tabular data (DataFrame)

DataFrame wraps a pandas frame plus per-column metadata and serializes to many formats — Parquet, Arrow/Feather, CSV, dict/JSON, JSON-LD, a Frictionless Data Package and HDF5 — with the qualifying metadata embedded or written as a sidecar.

import pandas as pd
from sdata.sclass.dataframe import DataFrame

sdf = DataFrame(df=pd.DataFrame({"weight": [10, 20], "height": [1.5, 1.6]}),
                name="specimen_01", description="a tension test")

# per-column annotations (only the fields you pass are changed)
sdf.set_column("weight", unit="kg", label="Gewicht", ontology="bfo:Quality")
sdf.col["height"].unit = "m"          # mutate the column Attribute in place
sdf.column_units                       # {'weight': 'kg', 'height': 'm'}

# serialize (optional <sname>.meta.jsonld sidecar; bytes/str without a path)
sdf.to_parquet(path="out", sidecar=True)      # out/<sname>.spq + sidecar
sdf.to_csv(path="out")                         # data-only CSV (pure pandas)
sdf.to_feather(path="out")                     # Arrow IPC + native per-column field metadata
sdf.to_datapackage(path="out")                 # Frictionless Data Package (.zip)
sdf.to_hdf(path="out")                         # HDF5 via h5py, one dataset/column (sdata[hdf])
DataFrame.from_parquet("out/specimen_01.spq")

# validate the table against a schema (missing/dtype/unit/extra columns)
from sdata.schema import TableSchema, AttrSpec
schema = TableSchema("TensileTable", [
    AttrSpec("weight", dtype="int", unit="kg", required=True),
])
report = sdf.validate_table(schema)            # ValidationReport (truthy if ok)

Arrow/Feather/Parquet need pip install "sdata[parquet]", HDF5 sdata[hdf]; CSV, dict, JSON-LD and the (CSV) Data Package work with the core install. See the Tabular data docs (docs/usage/dataframe.md) for the full reference.

Howto

Demo App

Try to paste some Excel-Data in the forms ...

Metadata

Attributes

  • name
  • value
  • dtype
  • unit
  • description
  • label
  • required
  • ontology (CURIE/IRI of the value's class, e.g. bfo:Quality)

dtypes for attributes

Every attribute value is coerced to a declared dtype (single source: sdata.dtypes), each with a lossless JSON-LD / XSD mapping:

  • int, float, str, bool
  • list (list of strings), floatlist (typed list of floats)
  • timestamp (ISO-8601 with timezone, stdlib zoneinfo)
  • date, time, duration (ISO-8601 / datetime types)
  • decimal (exact decimal), complex (complex number)
  • bytes (base64 in JSON), json (dict/list), uri
  • langstring (language-tagged string, rdf:langString, e.g. "Hallo@de")

Coercion is lenient by default (invalid values are logged and left unchanged). Pass strict=True (e.g. metadata.add(..., strict=True)) to raise DtypeError instead. See the conventions for the error policy.

paper

Metadata

Release files for sdata 1.5.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 sdata 1.5.0
File Size Uploaded Provenance
sdata-1.5.0.tar.gz 314.4 kB With provenance Details

Built distribution (wheel)

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

Total release size: 585.3 kB

Release files / sdata-1.5.0.tar.gz

Download URL sdata-1.5.0.tar.gz
Size 314.4 kB
Tags Source
SHA-256 checksum
How to use checksums
adf261aa19c029f0421a73df16166a3d919e0c77bbeacdabcf48f749463d4547
BLAKE2b-256 checksum
How to use checksums
820d51796be347d7e7c08bdcba9e23799d5e66d14b46bce7f808938715c0e1f6
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 19, 2026.

Transparency log

Release files / sdata-1.5.0-py3-none-any.whl

Download URL sdata-1.5.0-py3-none-any.whl
Size 270.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3ec8e3e4da206944c574e36acb335e9c19435ff33efd48448466b0592bf98cc
BLAKE2b-256 checksum
How to use checksums
f592ebfef5709437873f67f383ee859e63950ec5137fdeea392e59c46518cb8a
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 19, 2026.

Transparency log

Security for sdata 1.5.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sdata-1.5.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 Oct 19, 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.

Release history Release notifications | RSS feed

This release

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