Metadata-Version: 2.4
Name: roubikon
Version: 0.2.1
Summary: Flask web app for OSM road-network shortest-path navigation and street-view visualization
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: flask>=3.0
Requires-Dist: flask-cors>=4.0
Requires-Dist: pillow>=10.0
Requires-Dist: pyppeteer>=2.0
Requires-Dist: opencv-python>=4.8
Requires-Dist: numpy>=1.24
Requires-Dist: python-dotenv>=1.0
Requires-Dist: requests>=2.31
Requires-Dist: osmnx>=2.1
Requires-Dist: networkx>=3.6
Requires-Dist: matplotlib>=3.7
Requires-Dist: rasterio>=1.3
Requires-Dist: shapely>=2.0
Dynamic: license-file

# roubikon

A Flask-based package for shortest-path route visualization on road networks with street-level imagery.

## Features

- Serves a Flask web app with an interactive map interface
- Generates a side-by-side route video combining a 2D map view and street-level photos
- Supports pre-processed street view images or live Google Street View API fetching
- Barrier-free routing with configurable surface and elevation penalties
- Optional LLM-based routing adjustments via Claude API

## Installation

```bash
pip install roubikon
```

## Usage

### 1. Extract a road network graph

```python
from roubikon import extract_graph, print_graph_stats

extract_graph("Konstanz, Germany")
print_graph_stats("graph_export.txt")
```

This downloads the road network for the given city from OpenStreetMap and saves it as `graph_export.txt`.

### 2. Start the web app

```python
from roubikon import create_app

app = create_app(
    data_file="graph_export.txt",
    preprocessed_images_folder="augmented_konstanz_rn_small_preprocessed_rough",
)
app.run(debug=True, port=5000)
```

Then open [http://localhost:5000](http://localhost:5000) in your browser.

### 3. Optional: enable LLM-based routing adjustments

Pass a Claude API key to let users describe their mobility needs in natural language:

```python
app = create_app(
    data_file="graph_export.txt",
    preprocessed_images_folder="augmented_konstanz_rn_small_preprocessed_rough",
    anthropic_api_key="sk-ant-...",
)
```

Or set it as an environment variable:

```bash
export ANTHROPIC_API_KEY="sk-ant-..."
```

Get an API key at [console.anthropic.com](https://console.anthropic.com).

## Road network file format

The `graph_export.txt` file follows this structure:

```
<number of vertices>
<number of edges>
<id> <lat> <lon> <elevation>
...
<node_a> <node_b> <length> <surface_type> <wheelchair>
...
```
