Metadata-Version: 2.4
Name: py-osrm-backend
Version: 0.1.1
Summary: A Python implementation of OSRM backend core functionality
Home-page: https://github.com/GalTechDev/py-osrm-backend
Author: GalTechDev
License: MIT
Project-URL: Homepage, https://github.com/GalTechDev/py-osrm-backend
Project-URL: Repository, https://github.com/GalTechDev/py-osrm-backend
Project-URL: Issues, https://github.com/GalTechDev/py-osrm-backend/issues
Keywords: osrm,routing,osm,openstreetmap,dijkstra,navigation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: flask
Requires-Dist: osmium
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# py-osrm-backend

[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![PyPI version](https://img.shields.io/pypi/v/py-osrm-backend.svg)](https://pypi.org/project/py-osrm-backend/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Flask](https://img.shields.io/badge/Flask-API-green.svg)](https://flask.palletsprojects.com/)
[![OpenStreetMap](https://img.shields.io/badge/OSM-Compatible-brightgreen.svg)](https://www.openstreetmap.org/)
[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue.svg)](https://galtechdev.github.io/py-osrm-backend/)

A Python implementation of core OSRM (Open Source Routing Machine) functionality.

## Installation

```bash
pip install py-osrm-backend
```

## Features

- **OSM Parsing**: Parse `.osm` XML files to extract nodes and ways
- **Graph Building**: Build a routable graph with haversine distance weights
- **Routing**: Dijkstra's algorithm for shortest path computation
- **API Server**: Flask-based REST API compatible with OSRM-like endpoints

## Quick Start

```python
from osrm.extractor.graph_builder import GraphBuilder
from osrm.engine.dijkstra import DijkstraEngine

# Build graph from OSM
builder = GraphBuilder()
graph = builder.build_graph("your_map.osm")

# Route
engine = DijkstraEngine(graph)
distance, path = engine.shortest_path(start_id, end_id)
print(f"Distance: {distance} km, Path: {path}")
```

## Run Tests

```bash
python -m unittest discover -s tests -v
```

## License

MIT
