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). If it fails to decode it'll output false.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pluscodepy-0.0.7.tar.gz.
File metadata
- Download URL: pluscodepy-0.0.7.tar.gz
- Upload date:
- Size: 3.1 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af2051abed425cb75403e6d513bf55b7d5ef4b18e0d379d46b4b3c7126297f30
|
|
| MD5 |
267234ac5274d78c50377d61ca43fd0f
|
|
| BLAKE2b-256 |
96187b63cd1dfa882e2393ac3ecc51cb1b68d8cebad610bc394dbeb7c8f1c94d
|
File details
Details for the file pluscodepy-0.0.7-py3-none-any.whl.
File metadata
- Download URL: pluscodepy-0.0.7-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
daf51b093a2a37ce770cff9e5960d4e0a539521d93aca296c34c42084896d98e
|
|
| MD5 |
4773a7223a94de722d416f7ad2d5a7f8
|
|
| BLAKE2b-256 |
575b117071dc04eefb262f699904ffdcd879a6f83c00709410386d78c0464996
|