No project description provided
Project description
pygpsd
A tiny, typed Python client for talking to gpsd. Connect via plain TCP to your running gpsd instance (usually localhost:2947) and get structured GPS data back.
Installation
Pick your favorite tool:
Using uv (recommended):
# In an existing project
uv add pygpsd
# Or standalone with a venv
uv venv && source .venv/bin/activate
uv pip install pygpsd
Using pip:
pip install pygpsd
Works with Python 3.8+.
Quick Start
from pygpsd import GPSD, GPSInactiveWarning, NoGPSDeviceFoundException
try:
gpsd = GPSD() # Connects to localhost:2947
data = gpsd.poll()
except NoGPSDeviceFoundException:
print("No GPS device found")
except GPSInactiveWarning:
print("GPS found but no fix yet")
else:
# You've got typed GPS data!
print(f"Mode: {data.mode}")
print(f"Time: {data.time}")
print(f"Satellites: {len(data.get_used_satellites())}/{data.get_satellite_count()}")
print(f"Position: {data.geo.position.lat}, {data.geo.position.lon}")
What You Get
Main class:
GPSD(host="127.0.0.1", port=2947)— connects and starts watching
Get data:
gpsd.poll()→ returns aDataobject with everything
Exceptions to catch:
NoGPSDeviceFoundException— gpsd says no hardware foundGPSInactiveWarning— hardware exists but no fixUnexpectedMessageException— something weird from gpsd
Inside the Data object:
mode(Fix type),time(datetime),leap_seconds(int)satellites(list with signal strength, PRN, usage, etc.)geo(lat/lon/alt and more) andecef(3D cartesian coords)- Helpers:
get_used_satellites(),get_satellite_count()
Developing
Want to hack on pygpsd? Here's the quick setup:
# Clone and create venv
uv venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
# Install in editable mode
uv pip install -e .
# Quick test
python -c "from pygpsd import GPSD; print(GPSD().poll())"
This project uses standard Python packaging (PEP 621, Hatchling backend) with a uv.lock for reproducible installs.
Code Quality
The project uses pylint to check for code quality issues, including duplicate code detection:
# Install development dependencies
uv pip install pylint
# Run pylint on the entire project
pylint pygpsd/ tests/ --rcfile=.pylintrc
# Check only for duplicate code
pylint pygpsd/ tests/ --rcfile=.pylintrc --disable=all --enable=duplicate-code,similarities
Pylint runs automatically in CI/CD on every push and pull request.
Requirements
- A running gpsd daemon on port 2947 (or wherever you point it)
- Python 3.10 or newer
License
MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygpsd-1.3.0.tar.gz.
File metadata
- Download URL: pygpsd-1.3.0.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b16a8ecbd885ef13670aab80d0a4765b66b87f44fb6c218211b98cd8e6217a03
|
|
| MD5 |
43ec78785d74b01cbbceea585aefb8fb
|
|
| BLAKE2b-256 |
2a8b884925289ee7cb547b235ded22e69e1b55f7617c0df1d823861291bfdafc
|
Provenance
The following attestation bundles were made for pygpsd-1.3.0.tar.gz:
Publisher:
release.yml on nbdy/pygpsd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygpsd-1.3.0.tar.gz -
Subject digest:
b16a8ecbd885ef13670aab80d0a4765b66b87f44fb6c218211b98cd8e6217a03 - Sigstore transparency entry: 660516819
- Sigstore integration time:
-
Permalink:
nbdy/pygpsd@128a3178499b1e6230aeda59e21b0ec576383ffa -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/nbdy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@128a3178499b1e6230aeda59e21b0ec576383ffa -
Trigger Event:
push
-
Statement type:
File details
Details for the file pygpsd-1.3.0-py3-none-any.whl.
File metadata
- Download URL: pygpsd-1.3.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36f91a8d09d4e4749d7719c9d06bba939dc4919e29c6a206f77a9d5d6da5a033
|
|
| MD5 |
c7fe15fbf6789a9c165dadfea33e82a6
|
|
| BLAKE2b-256 |
c73b77a69438014bb2faa700e0e093e48fb2abe687dc249e5cc31c2fa228ae69
|
Provenance
The following attestation bundles were made for pygpsd-1.3.0-py3-none-any.whl:
Publisher:
release.yml on nbdy/pygpsd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygpsd-1.3.0-py3-none-any.whl -
Subject digest:
36f91a8d09d4e4749d7719c9d06bba939dc4919e29c6a206f77a9d5d6da5a033 - Sigstore transparency entry: 660516834
- Sigstore integration time:
-
Permalink:
nbdy/pygpsd@128a3178499b1e6230aeda59e21b0ec576383ffa -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/nbdy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@128a3178499b1e6230aeda59e21b0ec576383ffa -
Trigger Event:
push
-
Statement type: