Skip to main content

mgrs: Converting to and from MGRS and Decimal Degrees

GeoTrans provides C code for converting to and from MGRS, but well, it’s C code :). This is a simple ctypes wrapper around two of the MGRS-related functions in GeoTrans.

This library has an internal copy of some of the files from GeoTrans 2.4.2.

travisstatus

ChangeLog

1.3.7

  • automated building of osx, linux and win64 wheels

  • Migrate from TravisCI => GitHub Actions

  • Warnings cleanup

  • flake8 validation

1.3.6

1.3.4

1.3.3

1.3.2

  • Better Windows support

  • Bug fix for 3 digit longitudes

1.3.1

  • Python 3.x support

  • Allow user to override precision in UTMToMGRS

Usage

In a nutshell:

>>> import mgrs

>>> latitude = 42.0
>>> longitude = -93.0

>>> m = mgrs.MGRS()
>>> c = m.toMGRS(latitude, longitude)
>>> c
'15TWG0000049776'

>>> d = m.toLatLon(c)
>>> d
(41.999997975127997, -93.000000000000014)

>>> y = '321942.29N'
>>> yd = m.dmstodd(y)
32.328414

>>> d, m, s = m.ddtodms(32.328414)
>>> d, m, s
(32.0, 19.0, 42.290400)

You can also control the precision of the MGRS grid with the MGRSPrecision arguments in .toMGRS(). Other than that, there isn’t too much to it.

Metadata

Release files for mgrs 1.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mgrs 1.3.7
File Size Uploaded Provenance Actions
mgrs-1.3.7.tar.gz 30.4 kB Without provenance Details for mgrs-1.3.7.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mgrs 1.3.7
File Actions
mgrs-1.3.7-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details for mgrs-1.3.7-cp38-cp38-win_amd64.whl
mgrs-1.3.7-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details for mgrs-1.3.7-cp38-cp38-manylinux1_x86_64.whl
mgrs-1.3.7-cp38-cp38-macosx_10_14_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.14+ x86-64 Details for mgrs-1.3.7-cp38-cp38-macosx_10_14_x86_64.whl
mgrs-1.3.7-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details for mgrs-1.3.7-cp37-cp37m-win_amd64.whl
mgrs-1.3.7-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details for mgrs-1.3.7-cp37-cp37m-manylinux1_x86_64.whl
mgrs-1.3.7-cp37-cp37m-macosx_10_14_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64 Details for mgrs-1.3.7-cp37-cp37m-macosx_10_14_x86_64.whl
mgrs-1.3.7-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details for mgrs-1.3.7-cp36-cp36m-win_amd64.whl
mgrs-1.3.7-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details for mgrs-1.3.7-cp36-cp36m-manylinux1_x86_64.whl
mgrs-1.3.7-cp36-cp36m-macosx_10_14_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64 Details for mgrs-1.3.7-cp36-cp36m-macosx_10_14_x86_64.whl

Total release size: 302.1 kB

Release files / mgrs-1.3.7.tar.gz

Download URL mgrs-1.3.7.tar.gz
Size 30.4 kB
Tags Source
SHA-256 checksum
How to use checksums
34c3a7dcd0bc77ecac46a9543ccfe88062bebbad5341a25e33e2b22cce5db307
BLAKE2b-256 checksum
How to use checksums
b29f7d676a9ebbe5c89a174eaf286d1489bbcf5dcf3a6fc807ae50f6e2221a88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

Release files / mgrs-1.3.7-cp38-cp38-win_amd64.whl

Download URL mgrs-1.3.7-cp38-cp38-win_amd64.whl
Size 22.6 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
d89a652cf7f45480030383009e4826e3224511ac7c32922efd8a34278d8f8fd5
BLAKE2b-256 checksum
How to use checksums
767e4101abd02d07e3eceeb5c760dd84c951131d51b233cc7dd8e827884921a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

Release files / mgrs-1.3.7-cp38-cp38-manylinux1_x86_64.whl

Download URL mgrs-1.3.7-cp38-cp38-manylinux1_x86_64.whl
Size 46.8 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
e9be4331ee79bc59bb4dffc680300963b791dc469df7bf507a29abf5b257fb9c
BLAKE2b-256 checksum
How to use checksums
ff18d85ad7a2d019704820cc20c3636b32b8afe07833398f28b04c0186f8f895
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

Release files / mgrs-1.3.7-cp38-cp38-macosx_10_14_x86_64.whl

Download URL mgrs-1.3.7-cp38-cp38-macosx_10_14_x86_64.whl
Size 21.1 kB
Tags CPython 3.8 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
6c9264635aba9bdc1f7b843b1dd616592d426f8b9a14d02d9af008ace899a06c
BLAKE2b-256 checksum
How to use checksums
7c63d215bc61b58410d4646aa1306a94ea165efe136b0b6d5a2cd6418cec0e15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

Release files / mgrs-1.3.7-cp37-cp37m-win_amd64.whl

Download URL mgrs-1.3.7-cp37-cp37m-win_amd64.whl
Size 22.6 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
d0caf45ab2c80b9a113619e7c86a7448682088dd12b2de1576f74ea916f1b9cf
BLAKE2b-256 checksum
How to use checksums
54137a5b13a435799a634da8cae86ae7c181d970d37a571ef6223d9ee3be96a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

Release files / mgrs-1.3.7-cp37-cp37m-manylinux1_x86_64.whl

Download URL mgrs-1.3.7-cp37-cp37m-manylinux1_x86_64.whl
Size 46.8 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
87b8078bfa9adf25f757db9fca94879a379d76d346133d06779017d56cb184c4
BLAKE2b-256 checksum
How to use checksums
f4300b983848525b083c05d5912933c35d135f26792862cb0cb15f1f7ea96d1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

Release files / mgrs-1.3.7-cp37-cp37m-macosx_10_14_x86_64.whl

Download URL mgrs-1.3.7-cp37-cp37m-macosx_10_14_x86_64.whl
Size 21.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
d21dc727df22abbb619bb5674bc546b1e90659c8f5b932c38d2b6aec549f8aff
BLAKE2b-256 checksum
How to use checksums
f677cc59e3d41f538cae85a642fee204fd2adda1ae234128b7cbcbd4ff52d8c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

Release files / mgrs-1.3.7-cp36-cp36m-win_amd64.whl

Download URL mgrs-1.3.7-cp36-cp36m-win_amd64.whl
Size 22.6 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
450d254583d7ac2c7b20c3fd2ed132b69b77f37d8e29b995715fa45b50a8852c
BLAKE2b-256 checksum
How to use checksums
0e21685a6d6f0a318b461ad13ed48890e021de3b16f77ed252ced5b3f0ea0dda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

Release files / mgrs-1.3.7-cp36-cp36m-manylinux1_x86_64.whl

Download URL mgrs-1.3.7-cp36-cp36m-manylinux1_x86_64.whl
Size 46.8 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
0b29f778a8192aeb5c2129be62902b77083e411dd79938751d38939c95f6edbb
BLAKE2b-256 checksum
How to use checksums
f0620be2e07ca9ab73aa989d5aa3b9f1fe102cd2d5a0602b0154c35f73045e51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

Release files / mgrs-1.3.7-cp36-cp36m-macosx_10_14_x86_64.whl

Download URL mgrs-1.3.7-cp36-cp36m-macosx_10_14_x86_64.whl
Size 21.1 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
c7e937b18c67e0634438542f5bbc899a38b310d4815ec75d9c43f412b183ef4f
BLAKE2b-256 checksum
How to use checksums
4866d6f341df323ecaf7451f2f286d7d135f86b7bfa3e61cb2a099a927a3be50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.4

Security for mgrs 1.3.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page