Metadata-Version: 2.4
Name: kalix
Version: 1.0.0.dev0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Hydrology
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Requires-Dist: numpy>=1.22
Requires-Dist: pandas>=1.5
Requires-Dist: pytest>=7 ; extra == 'test'
Provides-Extra: test
Summary: Python interface for Kalix: hydrological modelling and Pixie (Gorilla-compressed) timeseries I/O
Author: Kalix contributors
License-Expression: MPL-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://chasegan.notion.site/Kalix-User-Guide-762687200b564e8e8c82b4f98879974f

# kalix (Python)

Python interface for [Kalix](https://chasegan.notion.site/Kalix-User-Guide-762687200b564e8e8c82b4f98879974f).

Current functionality:
- read and write Pixie files (`.pxt`, `.pxb`)

Planned:
- model loading & simulation
- programmatic model manipulation and building
- optimisation

## Install

```bash
pip install kalix
```

## Usage

```python
import kalix

# Read a .pxt/.pxb pair into a DataFrame
df = kalix.read_pixie("results.pxb")
print(df.head())

# Write a DataFrame back out
kalix.write_pixie("out.pxb", df)
```

The DataFrame index is a UTC `DatetimeIndex`; each column is one timeseries.

`read_pixie` accepts either extension (or no extension) and finds both files:

```python
kalix.read_pixie("results.pxb")  # same as
kalix.read_pixie("results.pxt")  # same as
kalix.read_pixie("results")
```

## Building from source

Requires Rust (1.70+) and [maturin](https://www.maturin.rs/).

```bash
# Editable install for development
cd python
maturin develop --release

# Build a wheel
maturin build --release
```

## Tests

```bash
maturin develop
pytest python/tests
```

