Skip to main content

Simple plus code to lat/long decoder written for White Flag Project

Project description

pluscodepy

Simple plus code to lat/long decoder written for White Flag Project.

Install

pip install pluscodepy

Usage

import pluscodepy

# The package works completely offline so it will require a a list of cities in
# JSON format, containing at least the city name and its latitude and longitude
# coordinates. Example of a valid JSON file would be:
# [{
#   "name": city,
#   "latitude": 1.921312,
#   "longitude": 213.123123
# },
# ...
# ]
with open('cities.json', 'r', encoding='utf-8') as json_file:
    converter = pluscodepy.Converter(json_file)

# Outputs a tuple containing the lat/long. In this example it is (1.5150625, 103.6549375)
print(converter.decode('GM83+2X Skudai, Johor'))

You can get city data from http://download.geonames.org/export/dump/ and downloading the dump of the country you are decoding against. Just make sure to convert it into a valid JSON before feeding it into the constructor.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pluscodepy-0.0.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pluscodepy-0.0.3-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file pluscodepy-0.0.3.tar.gz.

File metadata

  • Download URL: pluscodepy-0.0.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.2

File hashes

Hashes for pluscodepy-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4a7c26794df89f95d5b8e10494dab7948ad187047aed2703067b18d66e0582a6
MD5 9f0e482bfcf745c3c7e5725802e9e629
BLAKE2b-256 6d7b6a9a29a506c48374d2aea716d78974dc3a4f0a067258c3ba7e60ba0e3654

See more details on using hashes here.

File details

Details for the file pluscodepy-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pluscodepy-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.2

File hashes

Hashes for pluscodepy-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1fe73a79587718dfce37c51e0262ed70717f6ee811633f604c026e38f48245db
MD5 e227e97adc55c23bfee4466d48dd868a
BLAKE2b-256 9dc3e3c856cee32ca05e3d3da5f991b91d62b1d2fe566c9c9b9e35a0e9c26082

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page