pynmea2

Python library for parsing the NMEA 0183 protocol (GPS)

https://github.com/knio/pynmea2

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 40 committers (5.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.2%) to scientific vocabulary

Keywords

gps gps-data nmea-parser nmea-protocol nmea-sentences nmea0183 pynmea2 python
Last synced: 6 months ago · JSON representation

Repository

Python library for parsing the NMEA 0183 protocol (GPS)

Basic Info
  • Host: GitHub
  • Owner: Knio
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 279 KB
Statistics
  • Stars: 655
  • Watchers: 49
  • Forks: 229
  • Open Issues: 35
  • Releases: 4
Topics
gps gps-data nmea-parser nmea-protocol nmea-sentences nmea0183 pynmea2 python
Created over 12 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

pynmea2

pynmea2 is a python library for the NMEA 0183 protocol

pynmea2 is based on pynmea by Becky Lewis

The pynmea2 homepage is located at http://github.com/Knio/pynmea2

Compatibility

pynmea2 is compatable with Python 2.7 and Python 3.4+

Python version Build status Coverage status

Installation

The recommended way to install pynmea2 is with pip:

bash pip install pynmea2

PyPI version PyPI downloads

Parsing

You can parse individual NMEA sentences using the parse(data, check=False) function, which takes a string containing a NMEA 0183 sentence and returns a NMEASentence object. Note that the leading '$' is optional and trailing whitespace is ignored when parsing a sentence.

With check=False, parse will accept NMEA messages that do not have checksums, however it will still raise pynmea2.ChecksumError if they are present. check=True will also raise ChecksumError if the checksum is missing.

Example:

```python

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") msg ```

The NMEASentence object has different properties, depending on its sentence type. The GGA message has the following properties:

```python

msg.timestamp datetime.time(18, 43, 53) msg.lat '1929.045' msg.latdir 'S' msg.lon '02410.506' msg.londir 'E' msg.gpsqual '1' msg.numsats '04' msg.horizontaldil '2.6' msg.altitude 100.0 msg.altitudeunits 'M' msg.geosep '-33.9' msg.geosepunits 'M' msg.agegpsdata '' msg.refstation_id '0000' ```

Additional properties besides the ones explicitly in the message data may also exist.

For example, latitude and longitude properties exist as helpers to access the geographic coordinates as python floats (DD, "decimal degrees") instead of the DDDMM.MMMM ("Degrees, minutes, seconds") format used in the NMEA protocol. latitude_minutes, latitude_seconds, longitude_minutes, and longitude_seconds are also supported and allow easy creation of differently formatted location strings.

```python

msg.latitude -19.4840833333 msg.longitude 24.1751 '%02d°%07.4f′' % (msg.latitude, msg.latitudeminutes) '-19°29.0450′' '%02d°%02d′%07.4f″' % (msg.latitude, msg.latitudeminutes, msg.latitude_seconds) "-19°29′02.7000″" ```

Generating

You can create a NMEASentence object by calling the constructor with talker, message type, and data fields:

```python

import pynmea2 msg = pynmea2.GGA('GP', 'GGA', ('184353.07', '1929.045', 'S', '02410.506', 'E', '1', '04', '2.6', '100.00', 'M', '-33.9', 'M', '', '0000')) ```

and generate a NMEA string from a NMEASentence object:

```python

str(msg) '$GPGGA,184353.07,1929.045,S,02410.506,E,1,04,2.6,100.00,M,-33.9,M,,0000*6D' ```

File reading example

See examples/read_file.py

```python import pynmea2

file = open('examples/data.log', encoding='utf-8')

for line in file.readlines(): try: msg = pynmea2.parse(line) print(repr(msg)) except pynmea2.ParseError as e: print('Parse error: {}'.format(e)) continue ```

pySerial device example

See examples/read_serial.py

```python import io

import pynmea2 import serial

ser = serial.Serial('/dev/ttyS1', 9600, timeout=5.0) sio = io.TextIOWrapper(io.BufferedRWPair(ser, ser))

while 1: try: line = sio.readline() msg = pynmea2.parse(line) print(repr(msg)) except serial.SerialException as e: print('Device error: {}'.format(e)) break except pynmea2.ParseError as e: print('Parse error: {}'.format(e)) continue ```

Owner

  • Name: Tom Flanagan
  • Login: Knio
  • Kind: user
  • Location: Palo Alto, CA, USA

GitHub Events

Total
  • Issues event: 1
  • Watch event: 29
  • Issue comment event: 8
  • Push event: 1
  • Pull request review event: 1
  • Pull request review comment event: 2
  • Pull request event: 3
  • Fork event: 12
Last Year
  • Issues event: 1
  • Watch event: 29
  • Issue comment event: 8
  • Push event: 1
  • Pull request review event: 1
  • Pull request review comment event: 2
  • Pull request event: 3
  • Fork event: 12

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 182
  • Total Committers: 40
  • Avg Commits per committer: 4.55
  • Development Distribution Score (DDS): 0.478
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Tom Flanagan t****m@z****a 95
Michael Wooten j****n@h****l 10
joabakk g****b@h****m 9
Calvin c****o@g****m 7
rocco r****o@p****e 6
follower f****r@r****m 5
Randall Pittman R****n@o****u 4
Chris Kuethe c****b@g****m 4
roccodm r****o@a****t 3
kamiccolo k****o 3
rstolker r****r@g****m 3
xOneca x****a@g****m 3
zilvinas z****s@l****m 2
ruffy91 f****n@r****m 2
Tom Flanagan k****o@z****a 1
silentquasar 6****1@o****m 1
Dan Berglund d****n@m****m 1
Brent Barbachem b****d@d****u 1
CVertregt C****t 1
Col Ford c****d@s****m 1
pelter 3****r 1
nrbray 1****y 1
nalia3486 n****6@g****m 1
hetlelid s****m@h****o 1
freol35241 f****l@o****m 1
aayaffe a****e@g****m 1
Wolfgang Haupt a****f 1
Thomas Goodwin b****n 1
Simon H h****u@g****m 1
Randy Pittman r****n@o****m 1
and 10 more...

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 59
  • Total pull requests: 54
  • Average time to close issues: 4 months
  • Average time to close pull requests: 5 months
  • Total issue authors: 56
  • Total pull request authors: 40
  • Average comments per issue: 1.64
  • Average comments per pull request: 3.06
  • Merged pull requests: 32
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 11 days
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 2.0
  • Average comments per pull request: 3.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • suitor80 (2)
  • Shal-Ziar (2)
  • klint-k (2)
  • skoroneos (1)
  • fabien-degroote-dev (1)
  • npahucki (1)
  • RosiersRobin (1)
  • navado (1)
  • 17dshaikh (1)
  • FeirZhang (1)
  • freol35241 (1)
  • iannesbitt (1)
  • comperem (1)
  • rjenningsuk (1)
  • colford (1)
Pull Request Authors
  • kamiccolo (6)
  • JoepdeJong (5)
  • Knio (4)
  • barbacbd (4)
  • colford (2)
  • a1rwulf (2)
  • adedolapoadegboye (2)
  • xOneca (2)
  • kledom (2)
  • howroyd (2)
  • hetlelid (1)
  • aayaffe (1)
  • n1rupam (1)
  • DavisChappins (1)
  • pelter (1)
Top Labels
Issue Labels
bug (3) enhancement (1)
Pull Request Labels

Packages

  • Total packages: 18
  • Total downloads:
    • pypi 85,970 last-month
  • Total docker downloads: 317,691
  • Total dependent packages: 22
    (may contain duplicates)
  • Total dependent repositories: 206
    (may contain duplicates)
  • Total versions: 70
  • Total maintainers: 2
pypi.org: pynmea2

Python library for the NMEA 0183 protcol

  • Versions: 45
  • Dependent Packages: 21
  • Dependent Repositories: 203
  • Downloads: 85,970 Last month
  • Docker Downloads: 317,691
Rankings
Dependent packages count: 0.6%
Dependent repos count: 1.1%
Downloads: 1.8%
Average: 2.1%
Stargazers count: 2.6%
Docker downloads count: 2.7%
Forks count: 3.6%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.18: py3-nmea2-pyc

Precompiled Python bytecode for py3-nmea2

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 4.4%
Forks count: 6.7%
Stargazers count: 10.8%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.18: py3-nmea2

Python library for the NMEA 0183 protocol

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 4.4%
Forks count: 6.7%
Stargazers count: 10.8%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.14: py3-nmea2

Python library for the NMEA 0183 protocol

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Forks count: 4.9%
Stargazers count: 7.0%
Average: 8.4%
Dependent packages count: 21.7%
Maintainers (1)
Last synced: 6 months ago
alpine-edge: py3-nmea2

Python library for the NMEA 0183 protocol

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Forks count: 7.7%
Average: 8.6%
Stargazers count: 12.2%
Dependent packages count: 14.6%
Maintainers (1)
Last synced: 6 months ago
alpine-edge: py3-nmea2-pyc

Precompiled Python bytecode for py3-nmea2

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Forks count: 8.0%
Average: 8.7%
Stargazers count: 12.7%
Dependent packages count: 14.1%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.15: py3-nmea2

Python library for the NMEA 0183 protocol

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Forks count: 5.1%
Stargazers count: 7.6%
Average: 9.6%
Dependent packages count: 25.6%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.16: py3-nmea2

Python library for the NMEA 0183 protocol

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Forks count: 5.1%
Stargazers count: 8.3%
Average: 10.2%
Dependent packages count: 27.3%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.17: py3-nmea2

Python library for the NMEA 0183 protocol

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Forks count: 6.5%
Stargazers count: 10.1%
Average: 11.0%
Dependent packages count: 27.3%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: pynmea2
  • Versions: 4
  • Dependent Packages: 1
  • Dependent Repositories: 3
Rankings
Forks count: 12.5%
Stargazers count: 16.8%
Dependent repos count: 18.1%
Average: 19.1%
Dependent packages count: 29.0%
Last synced: 6 months ago
alpine-v3.19: py3-nmea2

Python library for the NMEA 0183 protocol

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.21: py3-nmea2

Python library for the NMEA 0183 protocol

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.19: py3-nmea2-pyc

Precompiled Python bytecode for py3-nmea2

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.22: py3-nmea2

Python library for the NMEA 0183 protocol

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.20: py3-nmea2-pyc

Precompiled Python bytecode for py3-nmea2

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.22: py3-nmea2-pyc

Precompiled Python bytecode for py3-nmea2

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.21: py3-nmea2-pyc

Precompiled Python bytecode for py3-nmea2

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.20: py3-nmea2

Python library for the NMEA 0183 protocol

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago