🌍 pyquadkey2
This is a feature-rich Python implementation of QuadKeys, an approach to geographical tiling, popularized by Microsoft to be used for Bing Maps.
In essence, the concept is to recursively divide the flat, two-dimensional world map into squares. Each square contains four squares as children, which again contain four squares and so on, up centimeter-level precision. Each of these squares is uniquely identifiable with a string like 021030032.
For more details on the concept, please refer to the original article.
muety/pyquadkey2 originates from a fork of buckhx/QuadKey, which is not maintained anymore. It builds on top of that project and adds:
- ✅ Several (critical) bug fixes
- ✅ Python 3 support
- ✅ Type hints for all methods
- ✅ Higher test coverage
- ✅ Cython backend for improved performance
- ✅ 64-bit integer representation of QuadKeys
- ✅ Additional features and convenience methods
Please note: This library is still in development and not considered 100 % stable. You may want to consider mercantile as an alternative (pure Python) implementation of QuadKeys. Also check What the Tile?.
Installation
Requirements
This library requires Python 3.13 or higher. To compile it from source, Cython is required in addition.
Using pip / uv
$ uv add pyquadkey2 # pip install pyquadkey2
Pip / uv installation is only tested for Linux and Mac, yet. If you encounter problems with the installation on Windows, please report them as a new issue.
From archive
$ wget https://github.com/muety/pyquadkey2/releases/download/0.3.4/pyquadkey2-0.3.4.tar.gz
$ pip install pyquadkey2-0.3.4.tar.gz
From source
Prerequisites (Linux)
gcc- Fedora:
dnf install @development-tools - Ubuntu / Debian:
apt install build-essential
- Fedora:
python3-devel- Fedora:
dnf install python3-devel - Ubuntu / Debian:
apt install python3-dev - Others: See here
- Fedora:
Prerequisites (Windows)
- Visual C++ Build Tools 2015 (with Windows 10 SDK) (see here)
Build
# Check out repo
$ git clone https://github.com/muety/pyquadkey2
# Init venv and install dependencies
$ uv sync
# Build distribution package
$ uv build
Developer Notes
Unit Tests
# Use env PYTHONPATH=./src as a option to choose test on src or test on installed package
PYTHONPATH=./src python3 -m unittest -v tests/test_*.py tests/*/test_*.py
Release
See here.
cd dist
uv tool twine upload --repository testpypi *
License
Apache 2.0
Release files for pyquadkey2 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyquadkey2-0.3.4.tar.gz | 12.2 kB | Details |
Built distributions (wheels)
Total release size: 881.9 kB
Release files / pyquadkey2-0.3.4.tar.gz
| Download URL | pyquadkey2-0.3.4.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
708915514e2d18d7c55b39db83d8ee0f16721e78d7547b46b056e54eff94fb71
|
|
BLAKE2b-256 checksum How to use checksums |
f29bb883339dab12d4125f4a0163af24045a7cb262f12de52dae89ac25bafd79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / pyquadkey2-0.3.4-cp314-cp314-win_amd64.whl
| Download URL | pyquadkey2-0.3.4-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 41.0 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9553d86325caeb24dcd75242af3df062e2b4deb95fe4abb1fc9914c6a88117a7
|
|
BLAKE2b-256 checksum How to use checksums |
1de525055f1c7db4f75bc7a5ffd8b91fbb40d9aee413a875785836d86bb1dff3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / pyquadkey2-0.3.4-cp314-cp314-musllinux_1_2_x86_64.whl
| Download URL | pyquadkey2-0.3.4-cp314-cp314-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 173.5 kB |
| Tags | CPython 3.14 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
51961eceb5acc3f9dc15677d2a12047de01e078e037bc8681149760d22e52df8
|
|
BLAKE2b-256 checksum How to use checksums |
3768a8d9e287f0c8afee2b301c84f124c6f083f15c5a2dc4cc742edc9b09c6fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / pyquadkey2-0.3.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | pyquadkey2-0.3.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 175.9 kB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
cabd08559a870824749589a9ad68ef3cf759b6df28050a81fc8b514d634fc4f6
|
|
BLAKE2b-256 checksum How to use checksums |
aa1c1dc2bb5f9a039405a47a09a3d4a237e82c805af7aaf358a4fa7b86152351
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / pyquadkey2-0.3.4-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | pyquadkey2-0.3.4-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 43.9 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
809dab06037b4f6ff6dd229b43d9dfb69f78cbfa1a836a7a9044b9a8fc5fa1be
|
|
BLAKE2b-256 checksum How to use checksums |
520cc2c6b44d3e43c02881709039a5055020c56cd042c716cf98b6538b2d6aba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / pyquadkey2-0.3.4-cp313-cp313-win_amd64.whl
| Download URL | pyquadkey2-0.3.4-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 40.3 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c54949944d124bfa1fc15a52e527a1161ee4049df46fe8c4dc08c150fe881baf
|
|
BLAKE2b-256 checksum How to use checksums |
0c8613b76ca19f6a93a706c3310c01eb06bdc0bc87192d1bd2f8b3daae222988
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / pyquadkey2-0.3.4-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | pyquadkey2-0.3.4-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 174.4 kB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
705935eaa6c2ff27ceca9f4d14458846c55d242134417e09cdd659cea04beb9f
|
|
BLAKE2b-256 checksum How to use checksums |
85432177faad7951ffd1375d1437fe89fccc61e543fc81f33eb63016e77c078b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / pyquadkey2-0.3.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | pyquadkey2-0.3.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 176.9 kB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
d0344d56c909bfa7d21caf8a9ec590e68b8b51a61da7f249ff321d0de83f4182
|
|
BLAKE2b-256 checksum How to use checksums |
656bcd1c8b61c5ffde274d53cc376c18e24207135bfd195062d56022613e5bb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / pyquadkey2-0.3.4-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pyquadkey2-0.3.4-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 43.9 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7a179787e69de5f8c00c79c27c9d12745b5385708f719dcffb97b071fcb9d877
|
|
BLAKE2b-256 checksum How to use checksums |
b4ad8e1018f9346a1f6a2f5fe87b7b2ccf4b89b49596bae99cfdbdc32114df7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|