Metadata-Version: 2.4
Name: onsight-map
Version: 0.2.1
Summary: Interactive production-network maps from a master layout table and a dynamic parameters table.
Author: Onsight
License: MIT License
        
        Copyright (c) 2026 Onsight
        
        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.
        
Project-URL: Homepage, https://github.com/YOUR_ORG/onsight-map
Project-URL: Documentation, https://github.com/YOUR_ORG/onsight-map#readme
Project-URL: Issues, https://github.com/YOUR_ORG/onsight-map/issues
Keywords: oil-and-gas,production-network,leaflet,dashboard,digital-twin,visualization
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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 :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.0
Requires-Dist: flask>=3.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# onsight-map

Interactive production-network map from two tables.

```bash
pip install onsight-map
```

## Tables

**Master:** `item_name`, `item_type`, `connected_to`, `x` (lon), `y` (lat)

**Dynamic:** `item_name`, `date`, plus any metrics (`pressure`, `flow_rate`, …)

The map shows **one shared date**. In the UI, change it from a single date textbox (not per row).

## Usage

```python
from onsight_map import OnsightMap

# From tables
m = OnsightMap.from_tables("master.csv", "dynamic.csv", date="2026-06-01")
m.show()
m.export_html("map.html")
m.export_model("plant.onsight")   # shareable model file

# One-liner from a shared model
OnsightMap.from_model("plant.onsight").export_html("map.html")
OnsightMap.from_model("plant.onsight").show()
```

## Dashboard

| Control | What it does |
|---------|----------------|
| **Edit Tables** | Shared date textbox + editable master/dynamic → **Apply to Map** |
| **Save Benchmark** | Snapshot into local SQLite |
| **Export Model** | Download a portable `.onsight` file |
| **Benchmarks** | Load / Export / Delete saved snapshots |

## Benchmarks database location

By default, saved benchmarks go to:

```text
~/.onsight_map/benchmarks.db
```

That is the user’s home directory:
- **macOS / Linux:** `/Users/<you>/.onsight_map/benchmarks.db` or `/home/<you>/.onsight_map/benchmarks.db`
- **Windows:** `C:\Users\<you>\.onsight_map\benchmarks.db`

Override when creating the map:

```python
OnsightMap.from_tables("master.csv", "dynamic.csv", benchmark_db="./my_benchmarks.db")
```

## Model file (`.onsight`)

JSON snapshot of master + dynamic + date. Share it with anyone who has the library:

```python
from onsight_map import OnsightMap
OnsightMap.from_model("shared.onsight").export_html("shared_map.html")
```
