Convert Lat, Lon to Minecraft coordinates and vice verca in BTE worlds
Project description
TerrapyConvert
A Python package for converting geographic coordinates to Minecraft coordinates and vice versa for the BuildTheEarth (BTE) project.
This is a Python port of the TypeScript terraconvert package, designed to provide clean, pythonic APIs for coordinate conversion.
Install with pip: https://pypi.org/project/terrapyconvert/
Installation
pip install terrapyconvert
Usage
from terrapyconvert import from_geo, to_geo
# Convert latitude/longitude to Minecraft coordinates
x, z = from_geo(48.856667, 2.350987) # Paris coordinates
print(f"Minecraft coordinates: x={x}, z={z}")
# Convert Minecraft coordinates back to latitude/longitude
lat, lon = to_geo(x, z)
print(f"Geographic coordinates: lat={lat}, lon={lon}")
API
Functions
from_geo(lat: float, lon: float) -> Tuple[float, float]: Convert geographic coordinates to Minecraft coordinatesto_geo(x: float, z: float) -> Tuple[float, float]: Convert Minecraft coordinates to geographic coordinatesfrom_geo_object(lat: float, lon: float) -> Dict[str, float]: Convert geographic coordinates to Minecraft coordinates (returns dict)to_geo_object(x: float, z: float) -> Dict[str, float]: Convert Minecraft coordinates to geographic coordinates (returns dict)
License
MIT License
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
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 terrapyconvert-1.0.1-py3-none-any.whl.
File metadata
- Download URL: terrapyconvert-1.0.1-py3-none-any.whl
- Upload date:
- Size: 330.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1efdd2155182bd153ed7d3dd464bd4eb97945a7a172c767996a85598b65fd109
|
|
| MD5 |
0494e0f6fb1edd3bb9a8952751882f4e
|
|
| BLAKE2b-256 |
334f41b823f6e8150a094cbbee3edd47db2a980fcd483ae5e2d630d9177298ef
|