The repo is python version of terraink
中文文档
now also ships a standalone Python renderer that skips the website entirely and writes map posters directly to png and svg.
Installation
Install from PyPI:
pip install terraink_py
Or with uv (recommended for CLI tools):
uv tool install terraink_py
Usage
Generate a poster from a place name:
terraink \
"Ganjingzi District, China" \
--theme midnight_blue \
--layout print_a4_portrait \
--language en \
--distance-m 4000 \
--format png svg \
--output outputs/ganjingzi
--location "..." still works; the positional argument is just a shorter alias.
To overlay routes from a running_page parquet, pass the repo slug or parquet URL:
terraink "Dalian" --running_page yihong0618/run --output outputs/dalian-run
When --running_page is set, the default --distance-m becomes 12000 unless you override it explicitly.
Development
Use uv in this repo:
uv sync --all-groups
Run the shared checks with prek:
uv run prek run --all-files
Then run via:
uv run terraink --help
Generate from coordinates in Python code:
from pathlib import Path
from terraink_py import PosterRequest, generate_poster
result = generate_poster(
PosterRequest(
output=Path("outputs/ganjingzi"),
formats=("png", "svg"),
lat=38.862405,
lon=121.513525,
title="Ganjingzi District",
subtitle="China",
theme="midnight_blue",
width_cm=21,
height_cm=29.7,
distance_m=4000,
include_buildings=True,
)
)
print(result.files)
Notes:
- The Python renderer uses Nominatim + Overpass directly, so it is designed for city and regional posters rather than world-scale exports.
svgoutput is true vector geometry, not a browser screenshot wrapped in SVG.- Place label language defaults to auto-detect from your title/subtitle/query. Use
--language enor--language zhto override it. - Chinese place names now auto-fallback to common CJK system fonts on macOS/Linux; if your machine still lacks glyph coverage, pass
--font-file /path/to/font.ttf. - The PyPI package name is
terraink_py, while the CLI command isterraink.
Metadata
Release files for terraink-py 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| terraink_py-0.6.1.tar.gz | 48.5 kB | Without provenance | Details for terraink_py-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| terraink_py-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for terraink_py-0.6.1-py3-none-any.whl |
Total release size: 85.3 kB
Release files / terraink_py-0.6.1.tar.gz
| Download URL | terraink_py-0.6.1.tar.gz |
|---|---|
| Size | 48.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d38c0801745e957b715300efdc491c529135f7a490076d55a0418e624ec2d6a8
|
|
BLAKE2b-256 checksum How to use checksums |
9562bc1fcf69362991272abc62ce95d73f001cd537746f297a2ff509b3a4d2c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / terraink_py-0.6.1-py3-none-any.whl
| Download URL | terraink_py-0.6.1-py3-none-any.whl |
|---|---|
| Size | 36.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb60d4823ec17504741f736cac3b0615799e832320936118c0fe56a39fd840fe
|
|
BLAKE2b-256 checksum How to use checksums |
435fc4938c51c70d303d299dec4dda2ecc2d87f050d3be0eec0080057c11343f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for terraink-py 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.