Repository navigation
Package the reporting tool, fix crashes on messy rows, add tests and CI - #1
Merged
Merged
Conversation
- Move the notebook logic into a report_tool package with a report-tool CLI - Validate each row: blank Status, non-numeric Price, unknown status and out-of-range discounts are skipped and listed with a reason, not fatal - Match columns by header name; clear errors for missing columns and bad files - Use Decimal for money; write time-stamped reports; cross-platform --open - Drop pyinputplus and the fixed 5-second sleep - Add pytest suite, pyproject.toml, ruff config, GitHub Actions CI, sample workbook - Update README to match the code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016gtNTGbmvq2DdoGC4air5K
royalpriest
added a commit
that referenced
this pull request
Nov 19, 2026
Package the reporting tool, fix crashes on messy rows, add tests and CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Royal · project thread
What changed
The notebook logic now lives in a
report_toolpackage with areport-toolcommand. These are the must-fix items from the review:AttributeError, and a Price like"$50"raisedValueError. Both killed the whole run. Now each row is validated: blank required fields, non-numeric prices, unknown statuses (for example "Pending", which used to vanish silently) and discounts outside 0–100 are skipped and listed in a SKIPPED ROWS section with the Excel row number and reason.Decimal, rounded to cents."$1,200"and"15%"are accepted.reports/booking_summary_YYYYMMDD_HHMMSS.txt) instead of overwritingbookingSummary.txt. They now include the cancellation rate, the average ticket, thousands separators, routes sorted busiest first, and dates without00:00:00.--out,--open(works on Windows, macOS and Linux),-vand--version. It still asks for the path if none is given.pyinputplus(no release since 2020) and the fixed 5-second sleep are gone. Exit codes are 0 for OK, 1 when there are no valid bookings, and 2 for bad input.openpyxlnow opens files withread_only=True, data_only=True, so formula cells return their values.Tests and tooling
pyproject.toml, ruff lint and format config, and GitHub Actions on Python 3.11–3.13.samples/bookings_sample.xlsxplussamples/make_sample.py. The sample includes 3 deliberately bad rows.main.py, which didn't exist.Project.ipynbis left unchanged for reference.How I checked
pytest: 29 passedruff check .andruff format --check .: cleanreport-tool samples/bookings_sample.xlsxwrites a report with 60 valid rows and 3 rows flagged as skippedNot in this PR
The HTML dashboard report and name masking from the mockups. Those can be a follow-up PR built on this package.
Generated by Claude Code