Skip to main content

PyGPX is a Python package that brings support for reading, writing and

Project description

PyGPX

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

PyGPX is a Python package that brings support for reading, writing and converting GPX files.

Installation

From PyPI

PyGPX is available on PyPI. Install with pip or your package manager of choice:

pip install gpx

From source

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

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

Documentation

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

Usage

Reading a GPX file

>>> from gpx import GPX
>>> # read the GPX data from file
>>> gpx = GPX.from_file("path/to/file.gpx")
>>> # print the bounds of the GPX data
>>> print(gpx.bounds)

Manipulating GPX data

>>> from gpx import Waypoint
>>>
>>> # delete the last waypoint
>>> del gpx.waypoints[-1]
>>>
>>> # add a new waypoint
>>> wpt = Waypoint()
>>> wpt.latitude = 52.123
>>> wpt.longitude = 4.123
>>> gpx.waypoints.append(wpt)

Writing a GPX file

>>> # write the GPX data to a file
>>> gpx.to_file("path/to/file.gpx")

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

gpx-0.2.1.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

gpx-0.2.1-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

Details for the file gpx-0.2.1.tar.gz.

File metadata

  • Download URL: gpx-0.2.1.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for gpx-0.2.1.tar.gz
Algorithm Hash digest
SHA256 90d25252432557a226ed54260f197cd7520226be3ea4573ea565c9544fc399b8
MD5 f8bb2fba78bf629da21cb304d380a6e7
BLAKE2b-256 95ed3757326aa4df3cf66d4aff5a4bfa2c0f4db9237a3a654be1a9aeb58a9aff

See more details on using hashes here.

File details

Details for the file gpx-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: gpx-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for gpx-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 10f34830d1cc7b35e3ee40d07b57ff7c8006c9e5b2b01111d111f23da9fa1e1d
MD5 a6c3a172e14655fe5fceb9d5e0c55f50
BLAKE2b-256 584b29a9d230f8dd07828904bb94c3c4ae5e8b3d9415b1878f4141bdf59234b4

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