Skip to main content

PaperMap is a Python package and CLI for creating ready-to-print paper maps.

Project description

PaperMap

PyPI Supported Python Versions pre-commit.ci status Test Documentation Status PyPI - License

PaperMap is a Python package and CLI for creating ready-to-print paper maps.

Installation

From PyPI

PaperMap is available on PyPI.

As a package

For use as a package, install PaperMap with pip or your package manager of choice:

pip install papermap

As a CLI tool

For use as a CLI tool, we recommend installing PaperMap with pipx:

pipx install papermap

From source

If you'd like, you can also install PaperMap from source (with flit):

git clone https://github.com/sgraaf/papermap.git
cd papermap
python3 -m pip install flit
flit install

Documentation

Check out the PaperMap documentation for the User's Guide and API Reference.

Usage

PaperMap can be used both in your own applications as a package, as well as a CLI tool.

As a package

Using the default values, the example below will create an portrait-oriented, A4-sized map of Bangkok at scale 1:25000:

>>> from papermap import PaperMap
>>> pm = PaperMap(13.75889, 100.49722)
>>> pm.render()
>>> pm.save("Bangkok.pdf")

You can easily customize the generated map by changing the tile server, size, orientation, etc. For an exhaustive list of all available options, please see the API Reference.

For example, the example below will create a landscape-oriented, A3-sized map of Madrid using the Stamen Terrein tile server, with a UTM grid overlay, at scale 1:50000:

>>> from papermap import PaperMap
>>> pm = PaperMap(
...     lat=40.416775,
...     lon=-3.703790,
...     tile_server="Stamen Terrain",
...     size="a3",
...     landscape=True,
...     scale=50_000,
...     add_grid=True,
>>> )
>>> pm.render()
>>> pm.save("Madrid.pdf")

As a CLI tool

Similarly, using the default values, the example below will create an portrait-oriented, A4-sized map of Bangkok at scale 1:25000:

$ papermap latlon -- 13.75889 100.49722 Bangkok.pdf

As with the package, maps generated through the CLI are also highly customizable. Please see the CLI Reference for an exhaustive list of all available options.

The example below will create a landscape-oriented, A3-sized map of Madrid using the Stamen Terrein tile server, with a UTM grid overlay, at scale 1:50000:

$ papermap latlon \
    --tile-server "Stamen Terrain" \
    --size a3 \
    --landscape \
    --scale 50000 \
    --grid \
    -- 40.416775 -3.703790 Madrid.pdf

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

papermap-0.3.0.tar.gz (36.8 MB view details)

Uploaded Source

Built Distribution

papermap-0.3.0-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file papermap-0.3.0.tar.gz.

File metadata

  • Download URL: papermap-0.3.0.tar.gz
  • Upload date:
  • Size: 36.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for papermap-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6e57f7b5f8c14d6048cd3412e2ce3b76db24f422c74d75572329a9007d43644c
MD5 16992d3410d5d98bd2e0d9b9b0b3f256
BLAKE2b-256 e33aa5ca7d70bcf9f4e5dd5e52698a22302a451ae763361f4799861de399ed81

See more details on using hashes here.

File details

Details for the file papermap-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: papermap-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for papermap-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 094f0ce732a31187952b3f14f9ac8149a0790d82c22a16df378d86cf8e8245f0
MD5 49c93b11c5c5949369e0fc3f535d7be8
BLAKE2b-256 0eb4650ba0a99bdc8632ccec6c81cad66a44bc82749932546c9fd23d75ba311b

See more details on using hashes here.

Supported by

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