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.9

  • MGRS now requires packaging library #31

  • Fix wheel imports of shared libs

1.3.8

  • UTF-8 encoding for all strings.

  • Fix #29 implicit tuple on return of UTMToMGRS

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.9

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.9
File Size Uploaded Provenance Actions
mgrs-1.3.9.tar.gz 31.5 kB Without provenance Details for mgrs-1.3.9.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mgrs 1.3.9
File Actions
mgrs-1.3.9-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details for mgrs-1.3.9-cp38-cp38-win_amd64.whl
mgrs-1.3.9-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details for mgrs-1.3.9-cp38-cp38-manylinux1_x86_64.whl
mgrs-1.3.9-cp38-cp38-macosx_10_14_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.14+ x86-64 Details for mgrs-1.3.9-cp38-cp38-macosx_10_14_x86_64.whl
mgrs-1.3.9-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details for mgrs-1.3.9-cp37-cp37m-win_amd64.whl
mgrs-1.3.9-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details for mgrs-1.3.9-cp37-cp37m-manylinux1_x86_64.whl
mgrs-1.3.9-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.9-cp37-cp37m-macosx_10_14_x86_64.whl
mgrs-1.3.9-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details for mgrs-1.3.9-cp36-cp36m-win_amd64.whl
mgrs-1.3.9-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details for mgrs-1.3.9-cp36-cp36m-manylinux1_x86_64.whl
mgrs-1.3.9-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.9-cp36-cp36m-macosx_10_14_x86_64.whl

Total release size: 307.1 kB

Release files / mgrs-1.3.9.tar.gz

Download URL mgrs-1.3.9.tar.gz
Size 31.5 kB
Tags Source
SHA-256 checksum
How to use checksums
123d0e1b0a052fc47e0f006f5403bd7f397947228297356e44b463db16a25dd5
BLAKE2b-256 checksum
How to use checksums
6f6f48ba7d68f4bb2fff397540348f626fbd763ffa4b412ff2123ecb09c0eb0a
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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

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

Download URL mgrs-1.3.9-cp38-cp38-win_amd64.whl
Size 23.0 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
d4996fe7f3bb6cf00aba0141864803b0c6bcb7393dd57fbd02cf34bc2fff0486
BLAKE2b-256 checksum
How to use checksums
b6eabe3bcb2b495ad160d990b8c9f15819c86edb0ba52116dc32bb0dc185a32d
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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

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

Download URL mgrs-1.3.9-cp38-cp38-manylinux1_x86_64.whl
Size 47.3 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
0396f7e5754a5fa665da683533339a3ce3b0131dc707c672032e0088a241535f
BLAKE2b-256 checksum
How to use checksums
6611a03f9e5c15d798dd2b45f1dc56a4ffe8c3d70526f9ee8f4f1319168c66b4
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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

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

Download URL mgrs-1.3.9-cp38-cp38-macosx_10_14_x86_64.whl
Size 21.6 kB
Tags CPython 3.8 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
18c51baeffedbffa4df4f3110899d36f203aa4d7b048338227d11fd1a9ffa740
BLAKE2b-256 checksum
How to use checksums
b522f42f9bc35f6c61fb4a4863ae6fb793dfdd7bade0de5e4774780b4df1228e
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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

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

Download URL mgrs-1.3.9-cp37-cp37m-win_amd64.whl
Size 23.0 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
2be9a1d3a0f1bcda94e5db51322205160c86e770a5cfb7eda50dc4363fd0b9fc
BLAKE2b-256 checksum
How to use checksums
d8f945ff7c95a5e1e114317cec058dc7bdacfd4f2502be7b7515ef40d4eee591
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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

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

Download URL mgrs-1.3.9-cp37-cp37m-manylinux1_x86_64.whl
Size 47.3 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
658408e79c3a354f65312b6a756ad5f8f4b984d175eca0c5b2b8a61053def731
BLAKE2b-256 checksum
How to use checksums
3e78debf32295aefff2cf554b0ccbde0036efcfa224627f32ef1d12c93602ad5
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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

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

Download URL mgrs-1.3.9-cp37-cp37m-macosx_10_14_x86_64.whl
Size 21.6 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
33c19bd6b9e73ef32cb4bbd76a78b1b45cfcb0e7daa0c6c7c3af6cff417bd9ed
BLAKE2b-256 checksum
How to use checksums
edc0b77168f831b43041327d5922a4be2040651ef1be23d35310e3d07810c96e
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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

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

Download URL mgrs-1.3.9-cp36-cp36m-win_amd64.whl
Size 23.0 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
2245d169cf7edf03bd4ec4e784beed719b8605daac53a4992c4aa272c9c00433
BLAKE2b-256 checksum
How to use checksums
f323163dbe42080cb1392c40c7f136435f0ba236495b955e481d2de6c3d0eb79
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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

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

Download URL mgrs-1.3.9-cp36-cp36m-manylinux1_x86_64.whl
Size 47.3 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
c785d05e88d09242f883d48085adc993c6b680284eec53779257c7c3b1a97d8b
BLAKE2b-256 checksum
How to use checksums
f57dd859d943e39154436ecde21f381219bb1354c5d55b765b2788b14ac62ad1
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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

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

Download URL mgrs-1.3.9-cp36-cp36m-macosx_10_14_x86_64.whl
Size 21.6 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
259776ec8789c1f9c3bc317d8447f444ae75f1bfb57e993ab507192151f98217
BLAKE2b-256 checksum
How to use checksums
b9bbf3b64c4c12d2a9fd9370d60b82f206f740d82626189fff7def7716b4a30c
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/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

Security for mgrs 1.3.9

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