lildrip
Stochastic rainfall disaggregation with the Bartlett-Lewis process
lildrip takes coarse-resolution rainfall data (e.g. hourly) and generates finer-resolution series (e.g. 10-minute intervals) using the Bartlett-Lewis stochastic process — a well-established model in hydrology.
Quick start
pip install lildrip
from lildrip import BartlettLewisModel
model = BartlettLewisModel()
events = model.identify_events(fine_series, inter_event_gap_minutes=30)
params = model.calibrate(events)
disagg = model.disaggregate(coarse_series, fine_interval_minutes=10)
Web API
pip install "lildrip[api]"
uvicorn api.main:app --host 0.0.0.0 --port 8000
Then POST /calibrar with a high-resolution CSV or POST /desagregar
with coarse data + pre-calibrated parameters. Both endpoints accept
configurable column names (time_column, rainfall_column).
See the full API docs below.
Demo
Run the examples from the repository root:
# No data? Generate sample CSV files first:
python examples/generate_demo_rain.py
# Full pipeline (calibrate → disaggregate → plot):
python examples/bartlett_lewis_demo.py
Model parameters
The Bartlett-Lewis model describes rainfall through five parameters calibrated via the Method of Moments.
| Parameter | Description |
|---|---|
| λ (lambda) | Storm frequency (events/day) |
| β (beta) | Pulses per storm |
| γ (gamma) | Storm termination rate |
| η (eta) | Pulse termination rate |
| μ (mu) | Pulse intensity (mm) |
Project structure
lildrip/
├── src/lildrip/
│ ├── __init__.py
│ ├── bartlett_lewis_model.py # Core model
│ └── plotting.py # Visualisation helpers
├── api/
│ ├── app.py # FastAPI application
│ └── main.py # Uvicorn entry point
├── examples/
│ ├── generate_demo_rain.py # Generate synthetic data
│ └── bartlett_lewis_demo.py # Calibrate + disaggregate demo
├── tests/
│ └── test_model.py
├── Dockerfile
├── pyproject.toml
└── README.md
License
Metadata
Release files for lildrip 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lildrip-0.1.0.tar.gz | 19.4 kB | Without provenance | Details for lildrip-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lildrip-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for lildrip-0.1.0-py3-none-any.whl |
Total release size: 38.3 kB
Release files / lildrip-0.1.0.tar.gz
| Download URL | lildrip-0.1.0.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1dc2897e15aa3f727e67da785e1d0e08e3ba4776735ac75aae85deba44084049
|
|
BLAKE2b-256 checksum How to use checksums |
acd290fa63c8da4a56f54715e80e4f65a8a7cf4160af79fcdeed4e8f2992d010
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.10
|
Release files / lildrip-0.1.0-py3-none-any.whl
| Download URL | lildrip-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76cab86da8035fa544e7d8a71b8cfc379a2987158046be360e26e83561def830
|
|
BLAKE2b-256 checksum How to use checksums |
f0ae576732488722a8f865ca0a8cd24ea98336956182c5b664caf79afa4f046c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.10
|
Security for lildrip 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.