Skip to main content

A Python port of MapSCII's vector-tile terminal renderer

Project description

mapscii-py

A Python port of MapSCII for rendering OpenStreetMap vector tiles in terminals. It provides both an interactive CLI and a Rich-compatible MapView renderable for embedding maps in terminal applications.

Installation

python3 -m pip install mapscii-py

The distribution name is mapscii-py; the Python import package is mapscii_py.

Command line

Start the interactive map:

mapscii

Arrow keys or hjkl move the map, a zooms in, z zooms out, and q exits. Render one non-interactive frame with:

mapscii --once --width 80 --height 24

The module entry point is equivalent:

python3 -m mapscii_py --once

Rich integration

MapView adapts its width to the surrounding Rich layout and keeps a fixed number of terminal rows:

from rich.console import Console

from mapscii_py import MapView

map_view = MapView(
    latitude=47.4979,
    longitude=19.0402,
    zoom=8,
    height=16,
)

Console().print(
    map_view.panel(title="Budapest airspace")
)

Markers can be overlaid without modifying the underlying map tiles:

from mapscii_py import MapMarker

map_view.set_markers([
    MapMarker(
        latitude=47.4979,
        longitude=19.0402,
        label="Budapest",
        symbol="●",
    ),
])

Development and publishing

Build and validate both the source distribution and wheel:

python3 -m pip install build twine
python3 -m build
python3 -m twine check dist/*

Upload a release to PyPI:

python3 -m twine upload dist/*

Increase the version in pyproject.toml and mapscii_py/__init__.py before building a new release. PyPI does not allow an existing release file or version to be replaced.

Attribution and license

This implementation is derived from MapSCII, originally created by Michael Straßburger and the MapSCII contributors. Map data is © OpenStreetMap contributors.

The project is distributed under the MIT License; see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mapscii_py-0.1.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mapscii_py-0.1.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file mapscii_py-0.1.0.tar.gz.

File metadata

  • Download URL: mapscii_py-0.1.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for mapscii_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 427d0827971217c1f38df8a7f84b187bb3592b5d135c01e4b365bf4948a094a4
MD5 5668c5d4fbe22936eabb144114d6aae6
BLAKE2b-256 91388968de6dd46b3a942dabda21570daf7ee225807c9b1eecda22c40b873a22

See more details on using hashes here.

File details

Details for the file mapscii_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mapscii_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for mapscii_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 065b7bada62f42389638435e28ef4abf3eaa0493ba6bca0da6b55abab750326c
MD5 8154fc4237afb3d67b54caca01e1d69d
BLAKE2b-256 9a73ef2d150725017e548f6593bb88f64735e5640e0fcca0127cef90aa5844c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page