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.1.0.tar.gz (22.4 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.1.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zarr_cm-0.1.0.tar.gz
  • Upload date:
  • Size: 22.4 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.1.0.tar.gz
Algorithm Hash digest
SHA256 e1780adf6b62321a42e8bf387a706d5cacb2f05cde799531fceb57f6fecebcbb
MD5 d0e1bf54c06caa9806da1f0e8700a814
BLAKE2b-256 4c603af9723cbb03d86ad8dde7787843ee221b6bbb81017b155c1839847a1d6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarr_cm-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: zarr_cm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 073c1105ba2f74f1e8d91003704b74c1e62bc289dfd40d4d21f59b154f2b351e
MD5 10277da46e20a5becebb51a02543d70a
BLAKE2b-256 0412a460b55d79da412ee936b51fc2d2ec8c59b5629c72f7ff93ccef4880630d

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarr_cm-0.1.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