# postdev360/openplaces architecture

> Architecture diagram of the GitHub repository postdev360/openplaces, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/postdev360/openplaces
- Repository: https://github.com/postdev360/openplaces

## Overview

openplaces is a standard-library mapping CLI for searching OpenStreetMap places, geocoding and reverse geocoding addresses, retrieving place details, and computing routes and isochrones. The main workflow enters through the CLI, resolves a search anchor when needed, queries a provider, and renders text, JSON, or GeoJSON. Separate geocoding and routing branches preserve their provider strategies; shared HTTP handling applies caching, throttling, and retries. The README documents these capabilities, while edges below are limited to relationships visible in excerpts or explicitly documented there; unsampled rendering and provider internals are not inferred.

Main entry points: [`src/openplaces/cli.py`](https://github.com/postdev360/openplaces/blob/main/src/openplaces/cli.py) (Command dispatch), [`src/openplaces/providers/overpass.py`](https://github.com/postdev360/openplaces/blob/main/src/openplaces/providers/overpass.py) (Place search/details), [`src/openplaces/http.py`](https://github.com/postdev360/openplaces/blob/main/src/openplaces/http.py) (HTTP transport), [`src/openplaces/config.py`](https://github.com/postdev360/openplaces/blob/main/src/openplaces/config.py) (Runtime configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["CLI and output"]
  node_cli["Command dispatch<br/>[cli.py]"]
  node_render["Output rendering<br/>[render.py]"]
end

subgraph group_location["Location and search"]
  node_taxonomy["Category taxonomy<br/>[taxonomy.py]"]
  node_geo["Coordinate validation<br/>[geo.py]"]
  node_geocoding["Geocoding strategy<br/>[geocoding.py]"]
  node_opening_hours["Hours evaluator<br/>[opening_hours.py]"]
end

subgraph group_network["Provider integrations"]
  node_overpass["Place search/details<br/>[overpass.py]"]
  node_ban["BAN geocoder<br/>[ban.py]"]
  node_photon["Photon geocoder<br/>[photon.py]"]
  node_ors["Routing/isochrones<br/>[ors.py]"]
end

subgraph group_runtime["Shared runtime"]
  node_http["HTTP transport<br/>[http.py]"]
  node_cache[("SQLite response cache<br/>[cache.py]")]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_user(("CLI user"))
node_osm(("OpenStreetMap data"))
node_ban_service(("BAN service"))
node_photon_service(("Photon service"))
node_ors_service(("OpenRouteService"))

node_user -->|"invokes"| node_cli
node_cli -->|"resolves places"| node_geocoding
node_cli -->|"validates bounds"| node_geo
node_cli -->|"searches/details"| node_overpass
node_cli -->|"requests routes"| node_ors
node_cli -->|"formats results"| node_render
node_cli -->|"lists categories"| node_taxonomy
node_cli -->|"manages cache"| node_cache
node_geocoding -->|"queries first"| node_ban
node_geocoding -->|"falls back"| node_photon
node_geocoding -->|"checks coordinates"| node_geo
node_overpass -->|"resolves tags"| node_taxonomy
node_overpass -->|"evaluates hours"| node_opening_hours
node_overpass -->|"computes distance"| node_geo
node_ban -->|"requests data"| node_http
node_photon -->|"requests data"| node_http
node_overpass -->|"requests data"| node_http
node_ors -->|"requests data"| node_http
node_http -->|"reads/writes"| node_cache
node_http -->|"reads settings"| node_config
node_ban -->|"reads endpoint"| node_config
node_photon -->|"reads endpoint"| node_config
node_overpass -->|"reads endpoint"| node_config
node_ors -->|"reads key/endpoint"| node_config
node_ban -->|"queries"| node_ban_service
node_photon -->|"queries"| node_photon_service
node_overpass -->|"searches data"| node_osm
node_ors -->|"requests routes"| node_ors_service

click node_cli "https://github.com/postdev360/openplaces/blob/main/src/openplaces/cli.py"
click node_render "https://github.com/postdev360/openplaces/blob/main/src/openplaces/render.py"
click node_taxonomy "https://github.com/postdev360/openplaces/blob/main/src/openplaces/taxonomy.py"
click node_geo "https://github.com/postdev360/openplaces/blob/main/src/openplaces/geo.py"
click node_geocoding "https://github.com/postdev360/openplaces/blob/main/src/openplaces/geocoding.py"
click node_opening_hours "https://github.com/postdev360/openplaces/blob/main/src/openplaces/opening_hours.py"
click node_overpass "https://github.com/postdev360/openplaces/blob/main/src/openplaces/providers/overpass.py"
click node_ban "https://github.com/postdev360/openplaces/blob/main/src/openplaces/providers/ban.py"
click node_photon "https://github.com/postdev360/openplaces/blob/main/src/openplaces/providers/photon.py"
click node_ors "https://github.com/postdev360/openplaces/blob/main/src/openplaces/providers/ors.py"
click node_http "https://github.com/postdev360/openplaces/blob/main/src/openplaces/http.py"
click node_cache "https://github.com/postdev360/openplaces/blob/main/src/openplaces/cache.py"
click node_config "https://github.com/postdev360/openplaces/blob/main/src/openplaces/config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_render,node_user toneBlue
class node_taxonomy,node_geo,node_geocoding,node_opening_hours toneAmber
class node_overpass,node_ban,node_photon,node_ors,node_ors_service toneMint
class node_http,node_cache,node_config toneRose
class node_osm,node_ban_service,node_photon_service toneIndigo
```

## Components

### CLI and output

- [Command dispatch](https://github.com/postdev360/openplaces/blob/main/src/openplaces/cli.py): `src/openplaces/cli.py`
- [Output rendering](https://github.com/postdev360/openplaces/blob/main/src/openplaces/render.py): `src/openplaces/render.py`

### Location and search

- [Category taxonomy](https://github.com/postdev360/openplaces/blob/main/src/openplaces/taxonomy.py): `src/openplaces/taxonomy.py`
- [Coordinate validation](https://github.com/postdev360/openplaces/blob/main/src/openplaces/geo.py): `src/openplaces/geo.py`
- [Geocoding strategy](https://github.com/postdev360/openplaces/blob/main/src/openplaces/geocoding.py): `src/openplaces/geocoding.py`
- [Hours evaluator](https://github.com/postdev360/openplaces/blob/main/src/openplaces/opening_hours.py): `src/openplaces/opening_hours.py`

### Provider integrations

- [Place search/details](https://github.com/postdev360/openplaces/blob/main/src/openplaces/providers/overpass.py): `src/openplaces/providers/overpass.py`
- [BAN geocoder](https://github.com/postdev360/openplaces/blob/main/src/openplaces/providers/ban.py): `src/openplaces/providers/ban.py`
- [Photon geocoder](https://github.com/postdev360/openplaces/blob/main/src/openplaces/providers/photon.py): `src/openplaces/providers/photon.py`
- [Routing/isochrones](https://github.com/postdev360/openplaces/blob/main/src/openplaces/providers/ors.py): `src/openplaces/providers/ors.py`

### Shared runtime

- [HTTP transport](https://github.com/postdev360/openplaces/blob/main/src/openplaces/http.py): `src/openplaces/http.py`
- [SQLite response cache](https://github.com/postdev360/openplaces/blob/main/src/openplaces/cache.py): `src/openplaces/cache.py`
- [Runtime configuration](https://github.com/postdev360/openplaces/blob/main/src/openplaces/config.py): `src/openplaces/config.py`

### Other components

- **CLI user**
- **OpenStreetMap data**
- **BAN service**
- **Photon service**
- **OpenRouteService**

## Connections

- CLI user → Command dispatch: invokes (evidence: `README.md`)
- Command dispatch → Geocoding strategy: resolves places (evidence: `src/openplaces/cli.py`)
- Command dispatch → Coordinate validation: validates bounds (evidence: `src/openplaces/cli.py`)
- Command dispatch → Place search/details: searches/details (evidence: `src/openplaces/cli.py`)
- Command dispatch → Routing/isochrones: requests routes (evidence: `src/openplaces/cli.py`)
- Command dispatch → Output rendering: formats results (evidence: `src/openplaces/cli.py`)
- Command dispatch → Category taxonomy: lists categories (evidence: `src/openplaces/cli.py`)
- Command dispatch → SQLite response cache: manages cache (evidence: `src/openplaces/cli.py`)
- Geocoding strategy → BAN geocoder: queries first (evidence: `src/openplaces/geocoding.py`)
- Geocoding strategy → Photon geocoder: falls back (evidence: `src/openplaces/geocoding.py`)
- Geocoding strategy → Coordinate validation: checks coordinates (evidence: `src/openplaces/geocoding.py`)
- Place search/details → Category taxonomy: resolves tags (evidence: `src/openplaces/providers/overpass.py`)
- Place search/details → Hours evaluator: evaluates hours (evidence: `src/openplaces/providers/overpass.py`)
- Place search/details → Coordinate validation: computes distance (evidence: `src/openplaces/providers/overpass.py`)
- BAN geocoder → HTTP transport: requests data (evidence: `src/openplaces/providers/ban.py`)
- Photon geocoder → HTTP transport: requests data (evidence: `src/openplaces/providers/photon.py`)
- Place search/details → HTTP transport: requests data (evidence: `src/openplaces/providers/overpass.py`)
- Routing/isochrones → HTTP transport: requests data (evidence: `src/openplaces/providers/ors.py`)
- HTTP transport → SQLite response cache: reads/writes (evidence: `src/openplaces/http.py`)
- HTTP transport → Runtime configuration: reads settings (evidence: `src/openplaces/http.py`)
- BAN geocoder → Runtime configuration: reads endpoint (evidence: `src/openplaces/providers/ban.py`)
- Photon geocoder → Runtime configuration: reads endpoint (evidence: `src/openplaces/providers/photon.py`)
- Place search/details → Runtime configuration: reads endpoint (evidence: `src/openplaces/providers/overpass.py`)
- Routing/isochrones → Runtime configuration: reads key/endpoint (evidence: `src/openplaces/providers/ors.py`)
- BAN geocoder → BAN service: queries (evidence: `README.md`)
- Photon geocoder → Photon service: queries (evidence: `README.md`)
- Place search/details → OpenStreetMap data: searches data (evidence: `README.md`)
- Routing/isochrones → OpenRouteService: requests routes (evidence: `README.md`)
