Metadata-Version: 2.4
Name: trailcli
Version: 0.1.0
Summary: A CLI tool for planning hiking, biking, and walking routes using OpenStreetMap data
Keywords: hiking,cli,gpx,openstreetmap,routing,geocoding
Author: Piet Brömmel
Author-email: Piet Brömmel <piet.broemmel@gmail.com>
License-Expression: MIT
Requires-Dist: httpx>=0.28.0
Requires-Dist: gpxpy>=1.6.0
Requires-Dist: ruff>=0.12.10 ; extra == 'dev'
Requires-Dist: ty>=0.0.1 ; extra == 'dev'
Requires-Dist: pytest>=8.4.1 ; extra == 'dev'
Requires-Dist: pre-commit>=4.3.0 ; extra == 'dev'
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/piebro/trailcli/
Project-URL: Repository, https://github.com/piebro/trailcli/
Project-URL: Issues, https://github.com/piebro/trailcli/issues
Provides-Extra: dev
Description-Content-Type: text/markdown

# trailcli

A CLI tool for planning hiking, biking, and walking routes using OpenStreetMap data.

## Usage

```bash
uvx trailcli --help
```

```bash
# Geocode a place name
trailcli geocode "Koblenz Hauptbahnhof" --country de

# Reverse geocode coordinates
trailcli reverse 50.3569 7.5890

# Route between two points
trailcli route 50.27 7.72 50.23 7.71 --costing pedestrian --output hike.gpx

# Stitch GPX files together
trailcli stitch approach.gpx trail.gpx exit.gpx --output dayhike.gpx

# Generate an HTML map
trailcli map dayhike.gpx --output dayhike.html --title "Rhine Day Hike"
```

Run `trailcli --help` for full documentation of all commands and options.

## API Services

This tool relies on free, community-run OpenStreetMap services. Please use them responsibly and respect their rate limits (1 request/second). If you find them useful, consider donating to keep them running.

- [Nominatim](https://nominatim.openstreetmap.org/) — Geocoding and reverse geocoding. [Donate to OpenStreetMap](https://supporting.openstreetmap.org/)
- [Valhalla (FOSSGIS)](https://valhalla1.openstreetmap.de/) — Routing engine for hiking, biking, and driving. [Donate to FOSSGIS](https://www.fossgis.de/verein/spenden/)

## Developing Setup

Install [uv](https://docs.astral.sh/uv/getting-started/installation/) and git and run the following commands to download the code and setup everything.

```bash
git clone https://github.com/piebro/trailcli.git
cd trailcli
uv sync
uv run pre-commit install
```

## Publishing

Update the `version` in `pyproject.toml`, commit, and then tag and push:

```bash
git tag v0.2.0
git push origin v0.2.0
```

A GitHub Action will automatically build and publish the new version to [PyPI](https://pypi.org/project/trailcli/).

## Contributing

Contributions are welcome. Open an issue if you want to report a bug or have a feature request.

## License

All code in this project is licensed under the [MIT License](LICENSE).
