Module to decode/encode indecipherable and confusing characters to/from latitude and longitude.
Project description
what3chars
what3chars is a Python module that provides functions for decoding and encoding confusing, hard to decipher characters to and from latitude and longitude coordinates. It combines lower case and upper case 'L's, 'I's, and '1's into geospatially unique but visually indecipherable strings.
Example:
>>> import what3chars
>>> print 'what3chars for 42.6, -5.6:', what3chars.encode(42.6, -5.6)
what3chars for 42.6, -5.6: LlIiILilLliIlL1LlIliIliIiIliL1l1LlIL
You can specify an arbitrary precision when encoding. The precision determines the number of characters in the what3chars:
>>> print 'what3chars for 42.6, -5.6:', what3chars.encode(42.6, -5.6, precision=20)
what3chars for 42.6, -5.6: LlIiILilLliIlL1LlIliI
Decoding a what3chars returns a (latitude, longitude) tuple:
>>> print 'Coordinate for what3chars LlIiILilLliIlL1LlIliI:', what3chars.decode('LlIiILilLliIlL1LlIliI')
Coordinate for what3chars LlIiILilLliIlL1LlIliI: ('42.6', '-5.6')
License
what3chars is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
what3chars is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with Geohash. If not, see http://www.gnu.org/licenses/.
This is a fork of https://github.com/vinsci/geohash
History
This is a parody of a popular geolocation system, and the code is a fork of Geohash by Leonard Norrgard. The only real changes are to replace the base32 pool of characters with combinations of indecipherable letters.
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 Distributions
Built Distribution
File details
Details for the file what3chars-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: what3chars-1.0.2-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15b16bef41cf4799aef31cc0d09f976c552c50c08586563e5efdc7effd05e34b |
|
MD5 | c580dbc85514f233fce3034ce622fff3 |
|
BLAKE2b-256 | 999e90b9dfa730e57920c8a3a00b931d16ba824cd350c97bdf935097b4be87e7 |