lucky-cli
A lottery CLI tool built with Python for fun. Installed command: lucky.
Supports Powerball (5 numbers 1–69 + special 1–26) and Mega Millions (5 numbers 1–70 + special 1–25).
Install (dev)
uv sync
uv run lucky --help
Usage
| Command | Description |
|---|---|
lucky pick <game> [--count N] |
Generate N valid random tickets |
lucky check <game> <n1..n5> --special <s> |
Check a ticket against the latest draw |
lucky show <game> |
Show the latest draw (date, numbers, special, jackpot) — default view |
lucky show <game> --history [--limit N] |
Show the last N draws |
lucky show <game> --stats |
Show number frequency, hot/cold numbers, odd/even distribution |
lucky --version |
Show the installed version |
Example:
lucky check powerball 12 18 33 44 61 --special 9
On every run, lucky checks for new draws and updates its local SQLite cache (~/.lucky-cli/lucky.db) before executing your command. If offline, it silently falls back to the cached data.
Project layout
src/lucky/
├── cli.py # Typer app entrypoint
├── commands/ # one module per subcommand
├── lottery/ # game rules + ticket generator
├── database/ # SQLAlchemy models/repository
├── updater/ # remote source + sync logic
└── console/ # Rich rendering helpers
tests/
See CLAUDE.md for the full architecture spec.
Development
uv sync # install deps
uv run pytest # run tests
uv run lucky <cmd> # exercise the CLI locally
Contributing
- Commits follow Conventional Commits:
feat:,fix:,docs:,refactor:,test:,chore:. Usefeat!:or aBREAKING CHANGE:footer for breaking changes. - Versioning is automated from git tags (
setuptools-scm) — never hand-edit a version string. - Route all CLI output through
src/lucky/console/; avoid rawprint(). - Add/update tests under
tests/for any change to generator, stats, checker, or database logic. - CI publishes to PyPI on
v*tags via.github/workflows/release.yml.
Releasing / Versioning
Version numbers are never hand-edited — they're derived from git tags via setuptools-scm. To cut a release:
- Find the last release tag (skip if this is the first release):
git describe --tags --abbrev=0
- Review commits since that tag:
git log <last-tag>..HEAD --oneline
- Classify them by Conventional Commits prefix to decide the version bump:
feat:→ MINORfix:→ PATCHfeat!:or aBREAKING CHANGE:footer → MAJOR- (first release with no prior tag: start at
v0.1.0)
- Add a new section to
CHANGELOG.md, grouped by category:## v0.3.0 ### Features - add stats command ### Fixes - fix check logic
- Commit the changelog update, then create and push the tag:
git add CHANGELOG.md git commit -m "chore: release v0.3.0" git tag v0.3.0 git push origin main v0.3.0
- Pushing the tag triggers
.github/workflows/release.yml, which runs the test suite, builds the package, and publishes to PyPI using thePYPI_API_TOKENsecret — nothing else to do manually.
Development process
This project is built with Claude Code using the Superpowers plugin as its development framework — brainstorming a design spec, writing an implementation plan, then executing it task-by-task with subagent-driven TDD and code review before each merge.
License
MIT — see LICENSE.
Metadata
Release files for lucky-cli 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lucky_cli-0.0.3.tar.gz | 81.6 kB | Without provenance | Details for lucky_cli-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lucky_cli-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for lucky_cli-0.0.3-py3-none-any.whl |
Total release size: 99.2 kB
Release files / lucky_cli-0.0.3.tar.gz
| Download URL | lucky_cli-0.0.3.tar.gz |
|---|---|
| Size | 81.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac945b5a2ff9ed89d86b1fe770a2292566742010630b2f035ddcfeeed3bd1008
|
|
BLAKE2b-256 checksum How to use checksums |
4c5077a4ed51186f42bf796e889e3e67f552ffce4e0009bd4931a1849cb69d5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / lucky_cli-0.0.3-py3-none-any.whl
| Download URL | lucky_cli-0.0.3-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
236f8bc090bc90e7f0e5309e27b2ed022a61aa803ba15ab06bb607c87b4b22b9
|
|
BLAKE2b-256 checksum How to use checksums |
b8b88a1de0b502881e0ac83fcdf212b3050a77524bbbd8d7fe76c5a06907da6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for lucky-cli 0.0.3
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.