gtravyl
gtravyl provides an easy way to take a grid-like layout and compute the shortest distance from any two desired cells in the grid.
How does it work?
Suppose you are trying to create a real time strategy game. You may have a grid-like map internally represented as a numpy array. It might look something like:
0001111
0001111
0000000
1101110
1101110
where the 1 indicates you cannot travel into that cell. Now you want to move a character that is in the cell with index (0, 0) to the bottom right corner. Ideally, you would like to know the shortest path too. This can be done easily with gtravyl, observe:
import numpy as np
import gtravyl as gt
world = np.array([[0, 0, 0, 1, 1, 1, 1],
[0, 0, 0, 1, 1, 1, 1],
[0, 0, 0, 0, 0, 0, 0],
[1, 1, 0, 1, 1, 1, 0],
[1, 1, 0, 1, 1, 1, 0]])
path = gt.shortest_path(world, (0, 0), (4, 6))
for cell in path:
world[cell] = 2
print(world)
This gives a path (represented by the cells with 2) that looks like one should expect:
[[2 2 2 1 1 1 1]
[0 0 2 1 1 1 1]
[0 0 2 2 2 2 2]
[1 1 0 1 1 1 2]
[1 1 0 1 1 1 2]]
Documentation
More documentation can be found on readthedocs.
Metadata
Release files for gtravyl 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gtravyl-0.1.6.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gtravyl-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / gtravyl-0.1.6.tar.gz
| Download URL | gtravyl-0.1.6.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ccc75b0ad90972981c9670b63ab9fb33b89cf66132f54026323869e2f184093
|
|
BLAKE2b-256 checksum How to use checksums |
08f92b0dd651fbae48ede687169a07257d915181944e1d5d2a3515d39393c5cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 11, 2026.
Transparency logRelease files / gtravyl-0.1.6-py3-none-any.whl
| Download URL | gtravyl-0.1.6-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f88a51a7b050b09ba8fdd2561315b39d97ae3b09c163611e06401b603fc0c1d
|
|
BLAKE2b-256 checksum How to use checksums |
4fcd44f994b8c50020885c27f11e05fcd758cc8e3c340687123abc329180baf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 11, 2026.
Transparency log