testsAndMisc/python_pkg/anki_decks/warsaw_districts
Krzysztof kuhy Rudnicki 2545d72710 test: achieve 100% branch coverage across all python_pkg packages
- Add comprehensive tests for all packages (3572 tests, 100% branch coverage)
- Split oversized test files to stay under 500-line limit
- Add per-file ruff ignores for test-appropriate suppressions
- Fix _cache_decks.py to properly convert JSON lists to tuples
- Add session-scoped conftest fixture for logging handler cleanup (Python 3.14)
- Update ruff pre-commit hook to v0.15.2
- Add codespell ignore words for test data
- Add generated output files to .gitignore
2026-03-21 17:51:36 +01:00
..
tests test: achieve 100% branch coverage across all python_pkg packages 2026-03-21 17:51:36 +01:00
__init__.py Consolidate all Anki deck generators into python_pkg/anki_decks/ 2026-02-07 15:32:23 +01:00
README.md Consolidate all Anki deck generators into python_pkg/anki_decks/ 2026-02-07 15:32:23 +01:00
run.sh feat: added run sh and makefile scripts 2026-02-22 22:00:50 +01:00
warsaw_districts_anki.py refactor: enforce 500-line limit on all Python source files 2026-03-17 22:47:42 +01:00
warsaw_districts.apkg Consolidate all Anki deck generators into python_pkg/anki_decks/ 2026-02-07 15:32:23 +01:00
warszawa-dzielnice.geojson Consolidate all Anki deck generators into python_pkg/anki_decks/ 2026-02-07 15:32:23 +01:00

Warsaw Districts Anki Generator

Generate Anki flashcards for learning the 18 districts (dzielnice) of Warsaw, Poland.

Features

  • Generates flashcards for all 18 Warsaw districts
  • Uses real district boundaries from OpenStreetMap data
  • Front of card: Map showing the full city with only the target district's border highlighted in bold
  • Back of card: District name in Polish
  • Self-contained .apkg file with embedded images
  • Compatible with AnkiWeb and AnkiDroid

Data Source

District boundaries are sourced from andilabs/warszawa-dzielnice-geojson, which provides accurate OpenStreetMap-based GeoJSON data for all Warsaw districts.

Installation

Install dependencies using your preferred method:

pyenv install 3.10  # or later
pyenv shell 3.10
pip install matplotlib genanki geopandas

Using pipx

pipx install --python python3.10 matplotlib genanki geopandas

Using system package manager (Arch Linux)

sudo pacman -S python-matplotlib python-geopandas
pip install genanki

Using pip directly

pip install matplotlib genanki geopandas

Usage

Generate flashcards

# From the repository root
python -m python_pkg.anki_decks.warsaw_districts.warsaw_districts_anki

This creates:

  • warsaw_districts.apkg - Self-contained Anki package with all images embedded

Custom options

# Custom output file
python -m python_pkg.anki_decks.warsaw_districts.warsaw_districts_anki --output my_cards.apkg

# Custom deck name
python -m python_pkg.anki_decks.warsaw_districts.warsaw_districts_anki --deck-name "Warszawa - Dzielnice"

Importing into Anki

  1. Open Anki
  2. File → Import
  3. Select the generated warsaw_districts.apkg file
  4. Click Import

That's it! All images are already embedded in the .apkg file.

Warsaw Districts

The generator includes all 18 official districts of Warsaw:

  1. Bemowo
  2. Białołęka
  3. Bielany
  4. Mokotów
  5. Ochota
  6. Praga-Południe
  7. Praga-Północ
  8. Rembertów
  9. Śródmieście
  10. Targówek
  11. Ursus
  12. Ursynów
  13. Wawer
  14. Wesoła
  15. Wilanów
  16. Włochy
  17. Wola
  18. Żoliborz

Development

Running tests

pytest python_pkg/warsaw_districts/tests/

Code quality

ruff check python_pkg/warsaw_districts/

License

Same as the parent repository.