pynmea2
Python library for the NMEA 0183 protcol
What it is and what it does
pynmea2 is a Python library that reads and writes NMEA 0183 protocol sentences—the standard format for GPS receivers, marine instruments, and navigation devices. It parses raw NMEA strings (like "$GPGGA,184353.07,1929.045,S,...") into Python objects with named fields, and can reconstruct NMEA strings from those objects. The library extracts structured data such as timestamp, latitude, longitude, altitude, and satellite count, and provides convenience properties to convert between NMEA's degree-minute-second format and decimal degrees.
The package is designed for applications that need to read GPS or marine data from serial ports, log files, or other NMEA sources. It handles optional checksums (can validate, require, or ignore them), supports multiple sentence types (GGA, RMC, etc.), and works with both Python 2.7 and modern Python 3 versions. No external dependencies are required—it installs as a single pure-Python wheel.
Use it for:
- Read GPS coordinates from a serial port and convert them to decimal degrees for mapping or location tracking
- Parse NMEA log files from marine instruments to extract and validate navigation data
- Build a real-time GPS dashboard that decodes live NMEA streams and displays position, altitude, and satellite info
- Generate NMEA sentences programmatically to simulate or test GPS device behavior
- Integrate GPS data into IoT or embedded systems that communicate via NMEA protocol
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses and generates NMEA 0183 sentences from GPS and marine navigation devices, converting raw protocol strings into Python objects with accessible fields.
Yes. The package is actively maintained, has no dependencies, installs cleanly, carries a permissive MIT license, and solves a specific and well-defined problem. Install it if you need to parse or generate NMEA 0183 sentences from GPS or marine devices.
Install
pynmea2 on PyPI
pip
pip install pynmea2uv
uv add pynmea2poetry
poetry add pynmea2Installing pynmea2
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance with last commit on 2026-04-21 and 680 repository stars.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike.
Quickstart
pip install pynmea2
import pynmea2
msg = pynmea2.parse("$GPGGA,184353.07,1929.045,S,02410.506,E,1,04,2.6,100.00,M,-33.9,M,,0000*6D")
print(msg.latitude, msg.longitude, msg.altitude)
Verify before relying
- Whether the package handles all NMEA 0183 sentence types or only a subset of the protocol
- Performance characteristics when parsing high-volume streams from serial devices
- Whether helper properties like latitude/longitude conversion are available for all sentence types
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,303 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 150,717/month — #10,958 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pynmea2-1.19.0-py3-none-any.whl
Keywords: python, nmea, gps, parse, parsing, nmea0183, 0183
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pyaisDecodes and encodes AIS (Automatic…
permissive · top 15,000 on PyPI
pynmeagpsParses and generates NMEA 0183 GPS/GNSS…
permissive · top 15,000 on PyPI
pyubx2Parses and generates UBX protocol messages from…
permissive · top 15,000 on PyPI
pyrtcmParses RTCM3 differential GNSS protocol…
permissive · top 15,000 on PyPI
lat-lon-parserParses latitude-longitude coordinate strings in…
permissive · top 15,000 on PyPI
gps3Provides Python clients to connect to a GPSD…
permissive · top 15,000 on PyPI
mgrsConverts between MGRS (Military Grid Reference…
permissive · top 15,000 on PyPI
pygeohashEncodes latitude/longitude coordinates to…
permissive · top 5,000 on PyPI
py-geohex3Converts between geographic coordinates…
permissive · top 15,000 on PyPI
suntimesCalculates sunrise and sunset times for any…
permissive · top 15,000 on PyPI