{"id":22903091,"url":"https://github.com/space-physics/maidenhead","last_synced_at":"2026-03-08T21:34:04.795Z","repository":{"id":54570566,"uuid":"132653071","full_name":"space-physics/maidenhead","owner":"space-physics","description":"Python Maidenhead \u003c--\u003e WGS84 coordinate conversions","archived":false,"fork":false,"pushed_at":"2025-05-25T06:27:22.000Z","size":111,"stargazers_count":24,"open_issues_count":3,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-28T12:22:16.413Z","etag":null,"topics":["amateur-radio","geolocation","maidenhead"],"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/space-physics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["scivision"],"ko_fi":"scivision"}},"created_at":"2018-05-08T19:06:16.000Z","updated_at":"2025-05-25T06:23:50.000Z","dependencies_parsed_at":"2023-01-29T08:00:13.157Z","dependency_job_id":null,"html_url":"https://github.com/space-physics/maidenhead","commit_stats":{"total_commits":99,"total_committers":8,"mean_commits":12.375,"dds":"0.24242424242424243","last_synced_commit":"8154b9b1a38573745de99f0452485857bf861333"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/space-physics/maidenhead","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-physics%2Fmaidenhead","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-physics%2Fmaidenhead/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-physics%2Fmaidenhead/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-physics%2Fmaidenhead/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/space-physics","download_url":"https://codeload.github.com/space-physics/maidenhead/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-physics%2Fmaidenhead/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30274432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["amateur-radio","geolocation","maidenhead"],"created_at":"2024-12-14T02:33:20.632Z","updated_at":"2026-03-08T21:34:04.790Z","avatar_url":"https://github.com/space-physics.png","language":"Python","funding_links":["https://github.com/sponsors/scivision","https://ko-fi.com/scivision"],"categories":[],"sub_categories":[],"readme":"# Maidenhead \u0026lt;-\u0026gt; Lat/Lon\n\n[![DOI](https://zenodo.org/badge/132653071.svg)](https://zenodo.org/badge/latestdoi/132653071)\n[![ci](https://github.com/space-physics/maidenhead/actions/workflows/ci.yml/badge.svg)](https://github.com/space-physics/maidenhead/actions/workflows/ci.yml)\n[![pypi versions](https://img.shields.io/pypi/pyversions/maidenhead.svg)](https://pypi.python.org/pypi/maidenhead)\n[![PyPi Download stats](http://pepy.tech/badge/maidenhead)](http://pepy.tech/project/maidenhead)\n\n`maidenhead` provides a simple, yet effective location hashing algorithm.\nMaidenhead allows global location precision down to 750m\n\nMaidenhead provides 4 levels of increasing accuracy\n\n  Level |  Precision\n--------|------------\n  1     |  World\n  2     |  Regional\n  3     |  Metropolis\n  4     |  City\n  5     |  Street\n  6     |  1m precision\n\n```sh\npip install maidenhead\n```\n\nor for development version\n\n```sh\ngit clone https://github.com/space-physics/maidenhead\n\npip install -e maidenhead\n```\n\nExamples assume first doing\n\n```python\nimport maidenhead as mh\n```\n\nLat, lon to Maidenhead locator:\n\n```python\nmh.to_maiden(lat, lon, level)\n```\n\nreturns a char (len = lvl*2)\n\nMaidenhead locator to lat lon:\n\n```python\nmh.to_location('AB01cd')\n```\n\ntakes Maidenhead location string and returns top-left lat, lon of Maidenhead grid square.\n\nThe `center=True` option outputs lat lon of the center of provided maidenhead grid square, instead of the default southwest corner.\n\n\nMaidenhead locator to [geoJSON](https://geojson.org/) ([RFC 7946](https://tools.ietf.org/html/rfc7946))\n\n```python\ngeo_obj = mh.to_geoJSONObject('AB01cd', center=True, nosquare=False)\ngeoJSON = json.dumps(geo_obj, indent=2)\n```\n\n\n## Command Line\n\nThe command line interface takes either decimal degrees for \"latitude longitude\" or the Maidenhead locator string:\n\n```sh\npython -m maidenhead 65.0 -148.0\n```\n\n\u003e BP65aa\n\n```sh\npython -m maidenhead BP65aa12\n```\n\n\u003e 65.0083 -147.9917\n\nThe \"python -m\" CLI is also available:\n\n```sh\npython -m maidenhead 65.0 -148.0\n```\n\nThe `--center` option outputs lat lon of the center of provided maidenhead grid square, instead of the default southwest corner.\n\n\n```sh\npython -m maidenhead --center --geojson EN35ld\n```\n\n\u003e {\"type\": \"FeatureCollection\", \"features\": [{\"type\": \"Feature\", \"properties\": {\"QTHLocator_Centerpoint\": \"EN35ld\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [-93.04166666666667, 45.145833333333336]}}, {\"type\": \"Feature\", \"properties\": {\"QTHLocator\": \"EN35ld\"}, \"geometry\": {\"type\": \"Polygon\", \"coordinates\": [[[-93.08333333333333, 45.125], [-93.08333333333333, 45.166666666666664], [-93.0, 45.166666666666664], [-93.0, 45.125], [-93.08333333333333, 45.125]]]}}]}\n\nThe `--center` option enables adding center point of the grid square as Point feature.\n\nThe `--nosquare` option  disables  adding Polygon feature for the requested grid square\n\n\n## Alternatives\n\nOpen Location Codes a.k.a Plus Codes are in\n[Python code by Google](https://github.com/google/open-location-code/tree/master/python).\n\nWeb convertor [Earth Point - Tools for Google Earth](https://www.earthpoint.us/Convert.aspx).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-physics%2Fmaidenhead","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspace-physics%2Fmaidenhead","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-physics%2Fmaidenhead/lists"}