Hexometry module
Project description
Hexometry
Python library to work with hexagon grid geometry.
Overview
Hexometry is a Python library to work with hexagon grid geometry. Some ideas of having x, y, z coordinates for hexagon grid are taken from this article by Jasper Flick.
Particulary this image gives a good idea of a choosen coordinates for hexagon grid:
Dependencies
This library has no dependencies apart from python stdlib, but it requires Python 3.10 or higher. There is no problem to make it work with Python 3.7 or 3.8, but the original intention was to try fancy features of modern Python.
Installation
pip install hexometry
Usage
from hexometry import Coord, Direction, Route
c1 = Coord(0, 0)
c2 = Coord(2, 3)
print(f"Coordinates {c1} and {c2} on a field are {c1-c2} hexes away each other")
route = c1 >> c2
print(f"and the route between them are: {route}. Let's traverse it:")
coord = c1
for direction in route:
coord += direction
print(f"moving {direction.value} to {coord}")
assert coord == c2
print("here we are")
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
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 hexometry-1.0.1.tar.gz.
File metadata
- Download URL: hexometry-1.0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2359cc210896b6eb614728e4549a84d57034418cc7d51eb5032474e5df3f3fe6
|
|
| MD5 |
0fbdca5fef4f326be0644fde946a1b4a
|
|
| BLAKE2b-256 |
861dbf8b5e95f5e0d3196b953e690d018e92f2f94f910e9e55275a91de6ce9e8
|
Provenance
The following attestation bundles were made for hexometry-1.0.1.tar.gz:
Publisher:
pypi-release.yml on wlame/hexometry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hexometry-1.0.1.tar.gz -
Subject digest:
2359cc210896b6eb614728e4549a84d57034418cc7d51eb5032474e5df3f3fe6 - Sigstore transparency entry: 159864623
- Sigstore integration time:
-
Permalink:
wlame/hexometry@bf93cacd93b7372c053b9126d34ab60ced083d83 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/wlame
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@bf93cacd93b7372c053b9126d34ab60ced083d83 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hexometry-1.0.1-py3-none-any.whl.
File metadata
- Download URL: hexometry-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
388e0d36884a500fcabf44703d442d4a8adc3a0d00c33933319872c979e905de
|
|
| MD5 |
5ea9b817539a009f1a1617fce79b1202
|
|
| BLAKE2b-256 |
b3d00e8baf8e13aa414ae049e104fb1f93c6d893e08e7cc52d3ee93722c09e42
|
Provenance
The following attestation bundles were made for hexometry-1.0.1-py3-none-any.whl:
Publisher:
pypi-release.yml on wlame/hexometry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hexometry-1.0.1-py3-none-any.whl -
Subject digest:
388e0d36884a500fcabf44703d442d4a8adc3a0d00c33933319872c979e905de - Sigstore transparency entry: 159864624
- Sigstore integration time:
-
Permalink:
wlame/hexometry@bf93cacd93b7372c053b9126d34ab60ced083d83 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/wlame
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@bf93cacd93b7372c053b9126d34ab60ced083d83 -
Trigger Event:
push
-
Statement type: