Skip to main content

Static map generator with points plots.

Project description

Traceplot

Traceplot is a library to generate static maps. You can download background maps from mapping services (Google Maps, Mapbox, OSM, ...) and plot your points on top. You can add markers, title, elevation graphs and more.

Installation

Traceplot is available on Pypi:

# Using uv
uv add traceplot
# Using pip
pip install traceplot

Usage

See more code in examples folder.

from traceplot.BackgroundImage import BackgroundImage
from traceplot.Trace import Trace


t: Trace = Trace(points_geo=points_geo)
t.addBackgroundImage(
    background_img=BackgroundImage(
        bbox=(2.117, 48.704, 2.557, 48.994), image_path="out/background_paris.png"
    )
)
t.addMarker(
    points_geo[0],
    img_path="img/marker_start.png",
    label_text="Start",
    marker_scale=0.5,
    label_offset_x=0.05,
)
t.addElevationGraph(height_pct=0.17, backgroundColor="white", backgroundColorAlpha=0.6)
t.plotPoints()
t.addTitle("Around Paris", center_x=0.5, center_y=0.2, fontsize=30)
t.save("out/day_one.png")
t.show()
t.close()

Maps providers

Current implemented maps providers are:

  • [done] Google Maps Static API
  • [todo] Mapbox
  • [todo] OSM
  • [todo] Geoapify

Developpement

Here are some useful commands for developpement:

# Run tests
make test
# Run lint
make lint
# Format code
make format
# Type checking
make mypy
# Get coverage
make coverage

These commands are available in Makefile.

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

traceplot-0.1.0.tar.gz (70.7 kB view details)

Uploaded Source

Built Distribution

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

traceplot-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: traceplot-0.1.0.tar.gz
  • Upload date:
  • Size: 70.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.11

File hashes

Hashes for traceplot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3d59b6bd610ab0f9240aa978c04d9f1292787a6c15df540b9db9b11b112e7386
MD5 21905ea9db40e906370e06e41ecd2c46
BLAKE2b-256 489a2674991461452072dc4133a0be08b98c34a831b84de428bc45a454c020e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: traceplot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.11

File hashes

Hashes for traceplot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5aabef2e515062a7a5a75a7ec2814f46d1c266acd2d8b34359dc53c3bfdb0471
MD5 eb4894bd664e4ac8ed265587bfe586c7
BLAKE2b-256 f14d6d2c747fe38237da38f06492af113117ad3e9e72fda40f8507eee6604c06

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