{"id":17334850,"url":"https://github.com/tfeldmann/gpsdclient","last_synced_at":"2025-04-13T21:34:31.947Z","repository":{"id":37530808,"uuid":"394624519","full_name":"tfeldmann/gpsdclient","owner":"tfeldmann","description":"A simple gpsd client and python library.","archived":false,"fork":false,"pushed_at":"2024-02-04T15:51:41.000Z","size":79,"stargazers_count":61,"open_issues_count":0,"forks_count":9,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-27T11:51:16.308Z","etag":null,"topics":["gps","gpsd","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tfeldmann.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"tfeldmann","patreon":null,"open_collective":null,"ko_fi":"tfeldmann","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["paypal.me/tfeldmann42"]}},"created_at":"2021-08-10T11:19:08.000Z","updated_at":"2025-02-02T21:27:16.000Z","dependencies_parsed_at":"2024-02-04T17:15:12.084Z","dependency_job_id":"e813f500-de54-4d4b-986e-aab37014a723","html_url":"https://github.com/tfeldmann/gpsdclient","commit_stats":{"total_commits":69,"total_committers":3,"mean_commits":23.0,"dds":0.08695652173913049,"last_synced_commit":"dc6be18d189a9dc6e8563aaf1d5b1519df7c593a"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfeldmann%2Fgpsdclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfeldmann%2Fgpsdclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfeldmann%2Fgpsdclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfeldmann%2Fgpsdclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tfeldmann","download_url":"https://codeload.github.com/tfeldmann/gpsdclient/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788168,"owners_count":21161721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gps","gpsd","python","python3"],"created_at":"2024-10-15T15:07:21.571Z","updated_at":"2025-04-13T21:34:26.926Z","avatar_url":"https://github.com/tfeldmann.png","language":"Python","funding_links":["https://github.com/sponsors/tfeldmann","https://ko-fi.com/tfeldmann","paypal.me/tfeldmann42"],"categories":[],"sub_categories":[],"readme":"# gpsdclient\n\n[![PyPI Version][pypi-version]][pypi-url]\n[![PyPI License][pypi-license]][mit-license]\n[![tests][test-badge]][test-url]\n\n\u003e A simple and lightweight [gpsd](https://gpsd.gitlab.io/gpsd) client and library\n\n## Installation\n\nNeeds Python 3 (no other dependencies).\nIf you want to use the library, use pip:\n\n```\npip3 install gpsdclient\n```\n\nIf you want to use only the standalone gpsd viewer, I recommend to use pipx:\n\n```\npipx install gpsdclient\n```\n\n## Library usage\n\n```python\nfrom gpsdclient import GPSDClient\n\n# get your data as json strings:\nwith GPSDClient(host=\"127.0.0.1\") as client:\n    for result in client.json_stream():\n        print(result)\n\n# or as python dicts (optionally convert time information to `datetime` objects)\nwith GPSDClient() as client:\n    for result in client.dict_stream(convert_datetime=True, filter=[\"TPV\"]):\n        print(\"Latitude: %s\" % result.get(\"lat\", \"n/a\"))\n        print(\"Longitude: %s\" % result.get(\"lon\", \"n/a\"))\n\n# you can optionally filter by report class\nwith GPSDClient() as client:\n    for result in client.dict_stream(filter=[\"TPV\", \"SKY\"]):\n        print(result)\n```\n\nYou can find the documentation for the available data and JSON fields in the\n[gpsd_json(5) manpage](https://www.mankier.com/5/gpsd_json).\n\n## Command line usage\n\nYou can use the `gpsdclient` standalone program or execute the module with\n`python3 -m gpsdclient`.\n\n```\n$ gpsdclient\nConnected to gpsd v3.17\nDevices: /dev/ttyO4\n\nMode | Time                 | Lat          | Lon          | Speed  | Track  | Alt       | Climb\n-----+----------------------+--------------+--------------+--------+--------+-----------+-----------\n1    | n/a                  | n/a          | n/a          | n/a    | n/a    | n/a       | n/a\n1    | n/a                  | n/a          | n/a          | n/a    | n/a    | n/a       | n/a\n1    | n/a                  | n/a          | n/a          | n/a    | n/a    | n/a       | n/a\n3    | n/a                  | 51.813360383 | 6.550329033  | n/a    | n/a    | 46.518    | 0.0\n3    | n/a                  | 51.813360383 | 6.550329033  | n/a    | n/a    | 46.518    | 0.0\n3    | 2021-08-13 14:06:25  | 51.813360383 | 6.550329033  | 0.674  | 260.53 | 46.518    | 0.0\n3    | 2021-08-13 14:06:27  | 51.81335905  | 6.550316283  | 0.54   | 245.71 | 46.002    | 0.0\n3    | 2021-08-13 14:06:28  | 51.8133673   | 6.55033345   | 0.422  | 241.88 | 46.476    | 0.0\n3    | 2021-08-13 14:06:29  | 51.813365833 | 6.5503352    | 0.34   | 246.35 | 46.868    | 0.0\n3    | 2021-08-13 14:06:30  | 51.81336285  | 6.550339117  | 0.242  | 246.35 | 47.22     | 0.0\n3    | 2021-08-13 14:06:31  | 51.8133614   | 6.550350367  | 0.273  | 246.35 | 46.846    | 0.0\n3    | 2021-08-13 14:06:32  | 51.813359233 | 6.550353767  | 0.226  | 246.35 | 46.635    | 0.0\n3    | 2021-08-13 14:06:33  | 51.8133574   | 6.550349817  | 0.221  | 246.35 | 46.52     | 0.0\n3    | 2021-08-13 14:06:34  | 51.813356733 | 6.550345917  | 0.319  | 274.21 | 46.453    | 0.0\n3    | 2021-08-13 14:06:35  | 51.813357917 | 6.5503521    | 0.149  | 274.21 | 46.529    | 0.0\n^C\n```\n\nOr use the raw json mode:\n\n```json\n$ gpsdclient --json\n{\"class\":\"VERSION\",\"release\":\"3.17\",\"rev\":\"3.17\",\"proto_major\":3,\"proto_minor\":12}\n{\"class\":\"DEVICES\",\"devices\":[{\"class\":\"DEVICE\",\"path\":\"/dev/ttyO4\",\"driver\":\"NMEA0183\",\"activated\":\"2021-08-13T12:25:00.896Z\",\"flags\":1,\"native\":0,\"bps\":9600,\"parity\":\"N\",\"stopbits\":1,\"cycle\":1.00}]}\n{\"class\":\"WATCH\",\"enable\":true,\"json\":true,\"nmea\":false,\"raw\":0,\"scaled\":false,\"timing\":false,\"split24\":false,\"pps\":false}\n{\"class\":\"SKY\",\"device\":\"/dev/ttyO4\",\"xdop\":0.87,\"ydop\":1.86,\"vdop\":0.93,\"tdop\":2.26,\"hdop\":1.36,\"gdop\":3.96,\"pdop\":1.65,\"satellites\":[{\"PRN\":1,\"el\":84,\"az\":318,\"ss\":22,\"used\":true},{\"PRN\":22,\"el\":78,\"az\":234,\"ss\":16,\"used\":true},{\"PRN\":21,\"el\":72,\"az\":115,\"ss\":0,\"used\":false},{\"PRN\":3,\"el\":55,\"az\":239,\"ss\":19,\"used\":true},{\"PRN\":17,\"el\":34,\"az\":309,\"ss\":20,\"used\":true},{\"PRN\":32,\"el\":32,\"az\":53,\"ss\":32,\"used\":true},{\"PRN\":8,\"el\":21,\"az\":172,\"ss\":13,\"used\":false},{\"PRN\":14,\"el\":18,\"az\":274,\"ss\":13,\"used\":false},{\"PRN\":131,\"el\":10,\"az\":115,\"ss\":0,\"used\":false},{\"PRN\":19,\"el\":9,\"az\":321,\"ss\":33,\"used\":true},{\"PRN\":4,\"el\":4,\"az\":187,\"ss\":0,\"used\":false},{\"PRN\":31,\"el\":1,\"az\":106,\"ss\":0,\"used\":false},{\"PRN\":69,\"el\":80,\"az\":115,\"ss\":17,\"used\":true},{\"PRN\":84,\"el\":73,\"az\":123,\"ss\":0,\"used\":false},{\"PRN\":85,\"el\":42,\"az\":318,\"ss\":26,\"used\":true},{\"PRN\":68,\"el\":33,\"az\":39,\"ss\":0,\"used\":false},{\"PRN\":70,\"el\":27,\"az\":208,\"ss\":0,\"used\":false},{\"PRN\":76,\"el\":12,\"az\":330,\"ss\":19,\"used\":true},{\"PRN\":83,\"el\":12,\"az\":133,\"ss\":16,\"used\":false},{\"PRN\":77,\"el\":9,\"az\":18,\"ss\":0,\"used\":false}]}\n{\"class\":\"TPV\",\"device\":\"/dev/ttyO4\",\"mode\":3,\"time\":\"2021-08-13T12:25:01.000Z\",\"ept\":0.005,\"lat\":51.813525983,\"lon\":6.550081367,\"alt\":63.037,\"epx\":13.150,\"epy\":27.967,\"epv\":21.390,\"track\":211.3400,\"speed\":0.000,\"climb\":0.000,\"eps\":62.58,\"epc\":42.78}\n^C\n```\n\nAll command line options:\n\n```\n$ gpsdclient -h\nusage: gpsdclient [-h] [--host HOST] [--port PORT] [--json]\n\nConnect to a running gpsd instance and show human readable output.\n\noptional arguments:\n  -h, --help   show this help message and exit\n  --host HOST  The host running GPSD (default: 127.0.0.1)\n  --port PORT  GPSD port (default: 2947)\n  --json       Output as JSON strings (default: False)\n```\n\n## Why\n\nI made this because I just needed a simple client library to read the json data gpsd is\nsending.\nThe other python libraries have various problems, like 100 % cpu usage, missing python 3\nsupport, license problems, lots of dependencies or they aren't available on PyPI.\nI also wanted a simple gpsd client to check if everything is working.\n\nThis client is as simple as possible with one exception: It supports the automatic\nconversion of \"time\" data into `datetime.datetime` objects.\n\nHave fun, hope you like it.\n\n## License\n\n[MIT][mit-license]\n\n\u003c!-- Badges --\u003e\n\n[pypi-version]: https://img.shields.io/pypi/v/gpsdclient\n[pypi-license]: https://img.shields.io/pypi/l/gpsdclient\n[pypi-url]: https://pypi.org/project/gpsdclient/\n[mit-license]: https://choosealicense.com/licenses/mit/\n[test-badge]: https://github.com/tfeldmann/gpsdclient/actions/workflows/tests.yml/badge.svg?branch=main\n[test-url]: https://github.com/tfeldmann/gpsdclient/actions/workflows/tests.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfeldmann%2Fgpsdclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftfeldmann%2Fgpsdclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfeldmann%2Fgpsdclient/lists"}