mirror of
https://github.com/kuhyx/testsAndMisc-archive.git
synced 2026-07-04 15:03:04 +02:00
Split 18+ Python files that exceeded 500 lines into smaller modules with helper files (prefixed with _). All functions are re-exported from the original modules to maintain backward compatibility with test patches and external imports. Files split: - moviepy_showcase.py (1212 -> 302 + 3 helpers) - anki_generator.py (1174 -> 473 + 4 helpers) - test_analyze_chess_game.py (1152 -> 361 + 2 parts) - poker_modifier_app.py (1024 -> 263 + 2 helpers) - transcribe_fw.py (1007 -> 342 + 3 helpers) - music_generator.py (1002 -> 319 + 2 helpers) - translator.py (951 -> 442 + 2 helpers) - cinema_planner.py (893 -> 369 + 2 helpers) - lichess_bot/main.py (757 -> 495 + _game_logic.py) - test_translator.py (725 -> 289 + part2 + conftest) - test_lichess_api.py (680 -> 475 + part2) - learning_pipe.py (668 -> 375 + 2 helpers) - cache.py (655 -> 360 + _cache_decks.py) - analyze_chess_game.py (632 -> 463 + _move_analysis.py) - visualize_q02.py (609 -> 371 + helper) - repo_explorer.py (602 -> 347 + 2 helpers) - keyboard_coop/main.py (515 -> 416 + _dictionary.py) - scanning.py (501 -> 314 + _enforce_loop.py) All tests pass: 144 lichess_bot (100% branch coverage), 243 others. No new lint errors introduced. |
||
|---|---|---|
| .. | ||
| tests | ||
| __init__.py | ||
| README.md | ||
| run.sh | ||
| warsaw_districts_anki.py | ||
| warsaw_districts.apkg | ||
| warszawa-dzielnice.geojson | ||
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:
Using pyenv (recommended)
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
- Open Anki
- File → Import
- Select the generated
warsaw_districts.apkgfile - 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:
- Bemowo
- Białołęka
- Bielany
- Mokotów
- Ochota
- Praga-Południe
- Praga-Północ
- Rembertów
- Śródmieście
- Targówek
- Ursus
- Ursynów
- Wawer
- Wesoła
- Wilanów
- Włochy
- Wola
- Żoliborz
Development
Running tests
pytest python_pkg/warsaw_districts/tests/
Code quality
ruff check python_pkg/warsaw_districts/
License
Same as the parent repository.