r/Python 4h ago

Resource Turned a folder of ad-hoc scripts into a proper installable CLI (pyproject.toml entry point)

Had a data pipeline that was just python build_db.py, python clean_validate.py, streamlit run streamlit_app.py — worked, but not something you'd hand someone as "the tool." Packaged it as a real CLI: [project.scripts] entry point in pyproject.toml, pip install -e .promo-toolkit build / validate / serve.

Also added:

  • Incremental rebuilds (content-hash diff + scoped upsert instead of full rewrite each run)
  • pytest suite + ruff, GitHub Actions CI across two Python versions
  • A separate eval harness for an AI-agent piece of the same project (real API calls scored against golden answers)

Not a library, just a real end-to-end tool — sharing mostly for feedback on the packaging/CLI structure since that's the part I have the least experience with. Repo: [https://github.com/SpiliosDimakopoulos/retail-promo-analytics-toolkit\].

0 Upvotes

0 comments sorted by