Metadata-Version: 2.4
Name: rollingstats
Version: 0.2.1
Summary: Lightweight sliding-window counters for streaming aggregation
Project-URL: Homepage, https://github.com/ElleNajt/rollingstats
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# rollingstats

Lightweight sliding-window counters for streaming aggregation.

```python
from rollingstats import SlidingCounter

counter = SlidingCounter(capacity=1000)
counter.add(42)
counter.add(58)
print(counter.total)  # 100
```

## Installation

```
pip install rollingstats
```

## API

### `SlidingCounter(capacity)`

Maintains a running total over a sliding window. When the total exceeds
`capacity`, the oldest entries are evicted.

- `.add(value)` — append a value
- `.total` — current sum
- `.empty` — True if no values recorded
- `.reset()` — clear all entries
