Skip to main content

🌍 Geo Anki

Python 3.12+ PyPI uv pre-commit pytest Ruff Coverage

🗺️ Overview

Generate map-based Anki flashcards from real geographic boundary data. Choose the subdivisions you want to learn and export a deck with embedded maps. Cards show the country and subdivision on the front, and a highlighted map on the back.

🚀 Getting started

Geo Anki is available on PyPI.

🖼️ Example flashcards

Indonesia

Front: Indonesia: Muaro Jambi

Back: Kabupaten Muaro Jambi — Jambi

Here, Jambi is the province, highlighted with a pale fill and bold outline.

Map of Sumatra highlighting Muaro Jambi in orange and Jambi province with a bold outline

Philippines

Front: Philippines: Camarines Sur

Back: Camarines Sur

Camarines Sur is highlighted in orange on a map of the whole Philippines.

Map of the Philippines highlighting Camarines Sur on Luzon in orange

The map also names a reference city or town for the province.

Bangladesh

Front: Bangladesh: ঢাকা

Back: Dhaka

Dhaka district is highlighted in orange on a map of the whole country, with reference cities marked. Card fronts use the English country name followed by the Bengali district name; map titles show both Bengali and English names.

Map of Bangladesh highlighting Dhaka district, with a Bengali and English title and reference cities

Germany

Front: Germany: Nordfriesland

Back: Kreis Nordfriesland — Schleswig-Holstein

The district is highlighted on a map of its entire Bundesland, with fixed reference cities for that state.

Map of Schleswig-Holstein highlighting Landkreis Nordfriesland with reference cities

Japan

Front: Japan: 広島県

Back: Hiroshima

Hiroshima is highlighted on a map of Japan's main islands, with reference cities and Okinawa in a boxed inset. Remote southern and southeastern islands are omitted. Card fronts use Japanese prefecture names; map titles show Japanese and English.

Map of Japan highlighting Hiroshima, with reference cities and a boxed Okinawa inset

📦 Installation

Requires Python 3.12+. Install the current release from PyPI:

pip install geo-anki

For development installation, see Development.

🃏 Usage

Generate a deck using the example Indonesia selection:

geo_anki \
  --country indonesia \
  --targets examples/indonesia.txt \
  --output outputs/indonesia.apkg

--targets accepts your own UTF-8 text file with one subdivision name per line. For Indonesia, use kabupaten/kota names without a province. For example:

Kutai Kartanegara
Muaro Jambi

Each supported country has a sample selection of 10 subdivisions in examples/, with generated decks in examples/outputs/:

Copy or edit an example input to choose your own subdivisions.

🧭 Build your own selection: targets/ contains the full lists, with the exact dataset spellings to copy into your target file.

We recommend using an AI chatbot of your choice to filter a list from targets/ into the subset you want, for example, "only Java kabupaten & kota". Save the resulting list as your --targets file.

Boundary data downloads automatically and is cached locally. Unknown or ambiguous names raise an error. The command produces an .apkg to import into Anki, PNG maps, and a JSON manifest. Run geo_anki --help for additional options.

For Bangladesh, target files accept either Bengali or English district names.

For Japan, target files accept English or Japanese prefecture names (including Japanese names without their suffix) and two-digit JIS codes. Card fronts use the Japanese name, while backs show its English name and a map with reference cities and a boxed Okinawa inset. Remote southern and southeastern islands are omitted. Map titles show both names.

For Germany, a shared name such as München selects the Landkreis; München (kreisfreie Stadt) selects the separate city. Official five-digit district codes (AGS) are also accepted.

📍 Data sources

Geo Anki's code is MIT-licensed; third-party data and fonts retain their own terms. See Third-party notices for source and license links, attribution, and outstanding source-license verification.

Indonesia boundaries come from Indonesia-Geojson-2026 (MIT; mashadinoor and ardian28). Coverage may be incomplete or outdated.

Philippines boundaries come from philippines-json-maps (PSGC 3Q 2026; MIT maps by James Faeldon), based on NAMRIA and PSA boundaries via OCHA COD-AB (CC BY-IGO 3.0).

Bangladesh district boundaries and bilingual names come from bangladesh-geocode (MIT; Nuhil Mehdy). Bengali text uses the bundled Noto Sans Bengali font (SIL Open Font License 1.1).

Germany uses BKG VG250 state and district boundaries (2026-01-01), converted to GeoJSON by Michael Kreil. © GeoBasis-DE / BKG 2026 (Daten verändert), licensed under Datenlizenz Deutschland – Namensnennung 2.0.

Japan prefecture boundaries come from MLIT National Land Numerical Information (N03, 2019-01-01), converted by Fabio Crisci in open-data-jp-prefectures-geojson (MIT conversion; MLIT source and terms). Japanese text uses a renamed subset of Noto Sans CJK JP, bundled under the SIL Open Font License 1.1.

💻 Development

Clone the repository and install its dependencies with uv:

git clone https://github.com/chrbrunk/geo-anki.git
cd geo-anki
uv sync --locked

From a repository checkout, use uv run geo_anki instead of geo_anki for the commands in Usage.

After setup, install the Git hooks once per checkout:

uv run pre-commit install

Hooks check configuration files, merge conflicts, filename case conflicts, debugger statements, whitespace, Ruff linting and formatting, and ty types. Commit messages must follow Conventional Commits, for example feat: add a country or fix: correct a map label. To run all configured checks across the repository manually:

uv run pre-commit run --all-files

Tox tests the built wheel with independently resolved dependencies on Python 3.12–3.15 in CI, without using uv.lock. To run locally (requires those Python versions), use uvx tox; for just Python 3.12, use uvx tox -e py312.

Metadata

Release files for geo-anki 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for geo-anki 0.2.0
File Interpreter ABI Platform Actions
geo_anki-0.2.0-py3-none-any.whl Python 3 none any Details for geo_anki-0.2.0-py3-none-any.whl

Release files / geo_anki-0.2.0-py3-none-any.whl

Download URL geo_anki-0.2.0-py3-none-any.whl
Size 189.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
456f2b61bf7cf51815b0ac4a106443f60d85c99fe9a0a1e0efb35e2ff022f7ea
BLAKE2b-256 checksum
How to use checksums
25966adc258fabc4067c1034a12fb89be471cdbd6d31f75ddef9a4464d8d1ef9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for geo-anki 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page