Skip to main content

cfdb

CF conventions multi-dimensional array storage on top of Booklet

build codecov PyPI version


Documentation: https://mullenkamp.github.io/cfdb/

Source Code: https://github.com/mullenkamp/cfdb


cfdb is a pure Python database for managing labeled multi-dimensional arrays following the CF conventions. It is an alternative to netCDF4/xarray, built on Booklet for local file storage and EBooklet for S3 sync. Thread-safe and multiprocessing-safe via locks.

Installation

pip install cfdb

Quick Example

import cfdb
import numpy as np

with cfdb.open_dataset('example.cfdb', flag='n') as ds:
    lat = ds.create.coord.lat(data=np.linspace(-90, 90, 181, dtype='float32'))
    lon = ds.create.coord.lon(data=np.linspace(-180, 180, 361, dtype='float32'))
    temp = ds.create.data_var.generic('temperature', ('latitude', 'longitude'), dtype='float32')
    temp[:] = np.random.rand(181, 361).astype('float32') * 40 - 10

with cfdb.open_dataset('example.cfdb') as ds:
    for slices, data in ds['temperature'].iter_chunks(include_data=True):
        print(slices, data.shape)

Multivariable Rechunking

Efficiently iterate over multiple variables with synchronized chunks:

with cfdb.open_dataset('data.cfdb') as ds:
    # Synchronized iteration over temperature and pressure
    for target_chunk, var_data in ds.iter_chunks({'latitude': 50, 'longitude': 50}):
        temp = var_data['temperature']
        pres = var_data['pressure']
        # Perform calculations on aligned blocks

See the full documentation for user guides, concepts, and API reference.

License

This project is licensed under the terms of the Apache Software License 2.0.

Download files

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

Source Distribution

cfdb-0.9.1.tar.gz (68.1 kB view details)

Uploaded Source

Built Distribution

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

cfdb-0.9.1-py3-none-any.whl (75.0 kB view details)

Uploaded Python 3

File details

Details for the file cfdb-0.9.1.tar.gz.

File metadata

  • Download URL: cfdb-0.9.1.tar.gz
  • Upload date:
  • Size: 68.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.7

File hashes

Hashes for cfdb-0.9.1.tar.gz
Algorithm Hash digest
SHA256 106b7cf47bc854644ba54983ba14392dec38de09ae297b49634434b4a34933a1
MD5 2641c00b87b84f49c8f86f8e0266ad9c
BLAKE2b-256 7ca0215651f6dc2c7440510280e59aff081c44a283f1ffca5edf79c054777630

See more details on using hashes here.

File details

Details for the file cfdb-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: cfdb-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 75.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.7

File hashes

Hashes for cfdb-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f350d816ab45804e0ad7e50d92c272efae88cb0f1d1e873c343d66e9583caa3d
MD5 be1b9eb2906d7fcf03e2b1c0c4fc682e
BLAKE2b-256 128647aa8b9ca532f38efbc4d8ea5e1334003008ee1160e31f7a8d89f9e4d925

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

This release

0.9.1 This release

2 files

0.9.0

2 files

0.8.7

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.10

2 files

0.5.9

2 files

0.5.8

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.5

2 files

0.3.4

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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