This tool automates Korean lottery ticket purchases, providing both a PySide6-based GUI for interactive use and a command-line script for headless execution, allowing users to buy tickets automatically without opening a web browser.
- Simple GUI built with PySide6
- Command-line script for headless execution
- Automated lottery purchase using Selenium
- No external web browser required
- Supports executable build with PyInstaller
-
Clone the repository
git clone https://github.com/leewr9/atlottery.git cd atlottery -
Install dependencies via uv
uv sync
uv run python cli_app.py- Executes the lottery automation script without opening the GUI.
- Uses environment variables for configuration:
LOTTERY_USER→ Lottery account IDLOTTERY_PASS→ Lottery account passwordLOTTERY_COUNT→ Number of tickets to purchase (default: 5)EMAIL_SENDER→ Email account for sending notifications (optional)EMAIL_PASSWORD→ Password for the email account (required ifEMAIL_SENDERis set)- For Gmail, you can use an App Password generated here: https://myaccount.google.com/apppasswords
- If both
EMAIL_SENDERandEMAIL_PASSWORDare provided, the script can send email notifications about the purchase result.
- Suitable for running in the background, scheduled tasks, or automated execution in GitHub Actions workflows.
uv run python gui_app.py- Launches the GUI for interactive use.
- Make sure the required resource files are correctly placed.
You can build an executable file using PyInstaller and the provided spec file.
uv run pyinstaller ./atlottery.spec- The executable will be created in the
distfolder. - Ensure the
atlottery.specfile is correctly configured with resource paths and build options.
This project is licensed under the MIT License. See the LICENSE file for details.
