Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 109 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,140 @@ Generate beautiful, minimalist map posters for any city in the world.

## Installation

### With uv (Recommended)
### 1. Using `uv` (Recommended)

Make sure [uv](https://docs.astral.sh/uv/) is installed. Running the script by prepending `uv run` automatically creates and manages a virtual environment.
The easiest and fastest way to run **maptoposter** is with [`uv`](https://docs.astral.sh/uv/), which automatically manages dependencies and virtual environments.

Install `uv` first, then choose one of the following options.

---

#### Run instantly with `uvx`

Use `uvx` if you just want to run the tool without installing it permanently.

```bash
uvx --from https://github.com/originalankur/maptoposter \
maptoposter --city "Paris" --country "France"
```

`uvx` will automatically download the project, install dependencies, and run the command.

---

#### Install as a reusable CLI (`uv tool install`)

If you plan to use the tool frequently, install it as a CLI command:

```bash
uv tool install git+https://github.com/originalankur/maptoposter
```

Then run it anywhere:

```bash
maptoposter --city "Paris" --country "France"
```

---

### 2. Local Installation

If you want to run or modify the project locally, clone the repository.

#### 2.1 Clone the repository

```bash
git clone https://github.com/originalankur/maptoposter
cd maptoposter
```

You can then run it in several ways.

---

##### Run directly with `uv run`

`uv run` automatically creates and manages a virtual environment.

```bash
# First run will automatically install dependencies
uv run ./create_map_poster.py --city "Paris" --country "France"
```

# Or sync dependencies explicitly first (using locked versions)
Dependencies will be installed automatically on first run.

---

##### Sync dependencies first (`uv sync`)

If you want reproducible environments using the locked versions:

```bash
uv sync --locked
uv run ./create_map_poster.py --city "Paris" --country "France"
```

### With pip + venv
---

##### Using `pip` + `venv`

Alternatively, you can install dependencies manually.

```bash
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
```

## Usage
Then run the script:

```bash
python create_map_poster.py --city "Paris" --country "France"
```

---

## Usage (Poster Generation)

After installation, generate a map poster using the preferred CLI or method.

### Using the `maptoposter` CLI (Recommended)

If you installed the CLI via `uv tool install`, you can run:

```bash
maptoposter --city <city> --country <country> [options]
```

Example:

### Generate Poster
```bash
maptoposter --city "Paris" --country "France"
```

If you're using `uv`:
---

### Using `uv run` (without permanent installation)

```bash
uv run ./create_map_poster.py --city <city> --country <country> [options]
```

Otherwise (pip + venv):
You can optionally sync dependencies first for reproducible versions:

```bash
uv sync --locked
uv run ./create_map_poster.py --city <city> --country <country>
```

---

### 3.3 Using `pip` + `venv` (Manual setup)

```bash
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python create_map_poster.py --city <city> --country <country> [options]
```

Expand Down
5 changes: 4 additions & 1 deletion create_map_poster.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ def list_themes():
print()


if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser(
description="Generate beautiful map posters for any city",
formatter_class=argparse.RawDescriptionHelpFormatter,
Expand Down Expand Up @@ -1049,3 +1049,6 @@ def list_themes():

traceback.print_exc()
sys.exit(1)

if __name__ == "__main__":
main()
37 changes: 10 additions & 27 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,24 @@ authors = [
keywords = ["map", "poster", "osm", "openstreetmap", "art", "visualization"]

dependencies = [
"certifi==2026.1.4",
"charset-normalizer==3.4.4",
"contourpy==1.3.3",
"cycler==0.12.1",
"fonttools==4.61.1",
"geographiclib==2.1",
"matplotlib==3.10.8",
"numpy==2.4.0",
"osmnx==2.0.7",
"geopandas==1.1.2",
"geopy==2.4.1",
"idna==3.11",
"kiwisolver==1.4.9",
"lat-lon-parser==1.3.1",
"matplotlib==3.10.8",
"networkx==3.6.1",
"numpy==2.4.0",
"osmnx==2.0.7",
"packaging==25.0",
"pandas==2.3.3",
"pillow==12.1.0",
"pyogrio==0.12.1",
"pyparsing==3.3.1",
"pyproj==3.7.2",
"python-dateutil==2.9.0.post0",
"pytz==2025.2",
"requests==2.32.5",
"scipy==1.16.3",
"shapely==2.1.2",
"six==1.17.0",
"tqdm==4.67.1",
"tzdata==2025.3",
"urllib3==2.6.3",
]

[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
requires = [ "hatchling" ]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["."]

[tool.setuptools]
py-modules = ["create_map_poster"]
[project.scripts]
maptoposter = "create_map_poster:main"
31 changes: 3 additions & 28 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
certifi==2026.1.4
charset-normalizer==3.4.4
contourpy==1.3.3
cycler==0.12.1
flake8==7.3.0
fonttools==4.61.1
geographiclib==2.1
matplotlib==3.10.8
numpy==2.4.0
osmnx==2.0.7
geopandas==1.1.2
geopy==2.4.1
idna==3.11
kiwisolver==1.4.9
lat_lon_parser==1.3.1
matplotlib==3.10.8
mccabe==0.7.0
networkx==3.6.1
numpy==2.4.0
osmnx==2.0.7
packaging==25.0
pandas==2.3.3
pillow==12.1.0
pycodestyle==2.14.0
pyflakes==3.4.0
pyogrio==0.12.1
pyparsing==3.3.1
pyproj==3.7.2
python-dateutil==2.9.0.post0
pytz==2025.2
requests==2.32.5
scipy==1.16.3
types-requests==2.32.4.20260107
shapely==2.1.2
six==1.17.0
tqdm==4.67.1
tzdata==2025.3
urllib3==2.6.3
Loading
Loading