Metadata-Version: 2.4
Name: firefinder
Version: 0.1.2
Summary: FireFinder+ event detection
Author: Geocene
License: MIT License
        
        Copyright (c) 2026 Geocene
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=1.5
Requires-Dist: numpy>=1.23
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Dynamic: license-file

# firefinder

A small, standalone FireFinder+ implementation with the same core logic used in at Geocene, plus lightweight preprocessing helpers.

![FireFinder+ Events](cooking_img.png)

## Install

From PyPI:

```bash
pip install firefinder
```

Local editable install while developing:

```bash
pip install -e .
```

## Usage

```python
import pandas as pd
from firefinder import prepare_timeseries, fire_detector_v2, group_events

df = pd.read_csv("metrics.csv")
df = prepare_timeseries(df, correction="false")
df = fire_detector_v2(df)

events = group_events(df)
print(events.head())
```

If your timestamps are epoch milliseconds:

```python
import pandas as pd
from firefinder import prepare_timeseries, fire_detector_v2, group_events

df = pd.read_json("data.json")
df["timestamp"] = pd.to_datetime(df["timestamp"], unit="ms", utc=True, errors="coerce")
df = prepare_timeseries(df, correction="false")
df = fire_detector_v2(df)
events = group_events(df)
print(events.head())
```

## Testing

```bash
pip install -e .[test]
python -m pytest
```

## Required columns

- `timestamp`
- `value`
- `sensor_type_id` (required if `correction="true"`)

## Notes

- `prepare_timeseries` mirrors the cleaning behavior from the original lambda processor.
- `correction="true"` uses ambient `sensor_type_id=9` and stove `sensor_type_id=1` when computing ambient-corrected values.
- You can pass a custom `sensors` mapping into `prepare_timeseries` to support additional stove sensor IDs.
