How ellisdickinson46/random-generator works
Project type and purpose
• This is a single-binary, desktop GUI application written in Python (generator.pyw + editor.pyw).
• Purpose: allow users to pick random items from lists via a “spinning wheel” UI and edit configurations.
File structure
• Entry points:
• generator.pyw – main random picker UI
• editor.pyw – configuration editor UI
• Core package (core/):
• Business logic (data.py, convert.py)
• Configuration management (configuration.py)
• Localization (locale_manager.py + assets/locales/*.po)
• Logging & errors (logger.py, errors.py)
• UI framework adapters & widgets (core/ui/)
• Static assets (assets/):
• Configuration files (config/):
• app_config.json, lists.json
• Vendored libraries (libs/):
• Third-party dependencies: aiofiles, darkdetect, logbook, playsound3, polib, pywinstyles, sv_ttk
README for technical stack
• Python ≥3.8
• GUI using Tkinter + Sun Valley themes (sv_ttk)
• Logging via Logbook
• Localization via GNU gettext (.po/.mo)
Components
a. Entry-point layer
─ generator UI
─ editor UI
b. Core application layer
─ UI framework & widgets
─ Business logic & data model
─ Configuration & file I/O
─ Logging & error handling
─ Locale management
c. Data layer
─ JSON config files
─ .po/.mo locale files
d. External/OS layer
─ File system
─ OS theme detection (darkdetect)
e. Vendored third-party libraries
Relationships & interactions
• Entry point → Core UI → Business logic → Data layer → File system
• Core UI calls theme manager (sv_ttk + darkdetect)
• Core logic calls logger (logbook)
• Locale manager loads .po/.mo files from assets
Architectural patterns & design principles
• Separation of concerns: UI vs. business logic vs. data
• Plugin-style vendoring of third-party libs
• MVC-ish: widgets/controllers (UI), core/data (model), entry scripts (view/controller)