cfdb
CF conventions multi-dimensional array storage on top of Booklet
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.
Metadata
Release files for cfdb 0.9.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cfdb-0.9.7.tar.gz | 75.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cfdb-0.9.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 157.6 kB
Release files / cfdb-0.9.7.tar.gz
| Download URL | cfdb-0.9.7.tar.gz |
|---|---|
| Size | 75.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
135d3b28e164ee09357bce44679a58011301db8bb570a9682034dbb76028f64b
|
|
BLAKE2b-256 checksum How to use checksums |
bf58249e58abde856c607e7d94276e84045ba2dbdf170033bc0af2afe8f291d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.7
|
Release files / cfdb-0.9.7-py3-none-any.whl
| Download URL | cfdb-0.9.7-py3-none-any.whl |
|---|---|
| Size | 82.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5dce9f6b14e135c479ae75956132f2ba471bbcf07407f1d473491d79c0f4a1fe
|
|
BLAKE2b-256 checksum How to use checksums |
8df8f40ad6af0eb32d0120e01174f0bcf96abfe933ab665a1f730e27a28bed18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.7
|