Skip to main content

Python implementation of Zarr Conventions Metadata

Project description

zarr-cm

Actions Status Documentation Status

PyPI version Conda-Forge PyPI platforms

GitHub Discussion

Coverage

Python types and utilities for Zarr Conventions Metadata.

Overview

zarr-cm provides typed Python support for the published Zarr conventions:

Convention Module Description
geo-proj zarr_cm.geo_proj Coordinate reference system information
spatial zarr_cm.spatial Spatial coordinate metadata
multiscales zarr_cm.multiscales Multiscale pyramid layout
license zarr_cm.license License specifiers
uom zarr_cm.uom Units of measurement

Each module provides:

  • TypedDict types for convention-specific metadata
  • create — create convention metadata
  • insert — add convention metadata to a Zarr attributes dict
  • extract — remove and return convention metadata from an attributes dict
  • validate — check runtime invariants the type system cannot express

Installation

pip install zarr-cm

Usage

from zarr_cm import geo_proj

# Create convention metadata
data = geo_proj.create(code="EPSG:4326")
print(data)
#> {'proj:code': 'EPSG:4326'}

# Validate
print(geo_proj.validate({"proj:code": "EPSG:4326"}))
#> {'proj:code': 'EPSG:4326'}

# Insert into an attributes dict
attrs = {"foo": "bar"}
result = geo_proj.insert(attrs, data)
print(result)
"""
{
    'foo': 'bar',
    'proj:code': 'EPSG:4326',
    'zarr_conventions': [
        {
            'uuid': 'f17cb550-5864-4468-aeb7-f3180cfb622f',
            'schema_url': 'https://raw.githubusercontent.com/zarr-experimental/geo-proj/refs/tags/v1/schema.json',
            'spec_url': 'https://github.com/zarr-experimental/geo-proj/blob/v1/README.md',
            'name': 'proj:',
            'description': 'Coordinate reference system information for geospatial data',
        }
    ],
}
"""

# Extract it back out
remaining, extracted = geo_proj.extract(result)
print(remaining)
#> {'foo': 'bar'}
print(extracted)
#> {'proj:code': 'EPSG:4326'}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zarr_cm-0.2.0.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zarr_cm-0.2.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file zarr_cm-0.2.0.tar.gz.

File metadata

  • Download URL: zarr_cm-0.2.0.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zarr_cm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 737f5b181e8a2456643c423f49b59d879531498c13c7345860f0e718ef73d8a8
MD5 eb282aca34a1b5649c0b4008e76a90a9
BLAKE2b-256 d84099c941d23a7cd84fb194b3eaa2ca2d0d85f5135aa07e2c4f2c12febfef43

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarr_cm-0.2.0.tar.gz:

Publisher: cd.yml on zarr-conventions/zarr-cm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zarr_cm-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: zarr_cm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zarr_cm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f4c778d70d37ccb6e10e1509f4c0a488689027dcebcd6b64fa89a899f101e11
MD5 750a32a64c02b89fe11f108131d8c7c0
BLAKE2b-256 546006c371c10a321db63ec46634c9498a3c491754214c0e3bfc27410c528d99

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarr_cm-0.2.0-py3-none-any.whl:

Publisher: cd.yml on zarr-conventions/zarr-cm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page