Metadata-Version: 2.4
Name: gluex-rcdb
Version: 0.2.2
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Dist: pytest ; extra == 'tests'
Provides-Extra: tests
Summary: Python bindings for the GlueX Run Condition Database
Keywords: gluex,rcdb,sqlite,conditions
Home-Page: https://github.com/denehoffman/gluex-rs
Author-email: Nathaniel Dene Hoffman <dene@cmu.edu>
License: Apache-2.0 OR MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/denehoffman/gluex-rs/tree/main/crates/gluex-rcdb-py
Project-URL: Homepage, https://github.com/denehoffman/gluex-rs
Project-URL: Issues, https://github.com/denehoffman/gluex-rs/issues
Project-URL: Repository, https://github.com/denehoffman/gluex-rs

# gluex-rcdb (Python)

Python bindings for the `gluex-rcdb` crate. This library provides a simple interface for loading run conditions from RCDB which match the given context (run numbers and filters). It also provides common aliases used to determine production data.

## Installation

```bash
uv pip install gluex-rcdb
```

## Example

```python
import gluex_rcdb as rcdb

# Uses RCDB_CONNECTION by default; pass a path to override.
client = rcdb.RCDB()
filters = rcdb.all(
    rcdb.float_cond("polarization_angle").gt(90.0),
    rcdb.aliases.is_production,
)
run_list = client.fetch_runs(run_min=55_000, run_max=55_020, filters=filters)
values = client.fetch(["polarization_direction", "polarization_angle"], runs=run_list)
for run, payload in values.items():
    print(run, float(payload["polarization_direction"]))
```

## License

Dual-licensed under Apache-2.0 or MIT.

