docs: the Python package — install with maturin, h5py-style reading

README gains a Python section (maturin develop into a venv, a reading
example that was run against an h5py-written file, the supported types
and keys, what writing covers). The crate README says the same in more
detail. QUICKSTART showed clawhdf5.open()/read_f64(), which never
existed; it now shows File(...)[...].

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-09-26 08:21:48 -05:00
co-authored by Claude Opus 5.5
parent f7d88bb4fb
commit c3850a0b66
3 changed files with 107 additions and 14 deletions
+9 -6
View File
@@ -395,19 +395,22 @@ clawhdf5 --path agent.h5 snapshot backup_2026-03-19.h5
Read HDF5 files from Python without libhdf5:
```bash
pip install clawhdf5 # coming soon — build from source for now
cd crates/clawhdf5-py && maturin develop
# Not on PyPI yet: build from source into a virtualenv
pip install maturin numpy
cd crates/clawhdf5-py && maturin develop --release
```
```python
import clawhdf5
# Read
f = clawhdf5.open("data.h5")
temps = f.read_f64("temperatures")
print(temps) # [22.5, 23.1, 21.8]
# Read (h5py-style)
with clawhdf5.File("data.h5", "r") as f:
temps = f["temperatures"][:]
print(temps) # [22.5 23.1 21.8]
```
See `crates/clawhdf5-py/README.md` for the supported types and indexing.
---
## Common Patterns