Tip Splitter CLI is a tiny command-line utility that splits a restaurant bill across a group, including optional tax and tip percentages.
Problem: Splitting a bill is a common small annoyance, especially when tax and tip need to be included. People can do the math manually, but it is easy to make mistakes or slow down the end of a meal.
Solution: tip_splitter.py takes a subtotal, number of people, optional tip percentage, and optional tax percentage. It prints the subtotal, calculated tax, calculated tip, total, and per-person share in a readable format.
Key features:
- Splits a bill across any positive number of people.
- Supports custom tip percentage with --tip.
- Supports custom tax percentage with --tax.
- Formats output as currency.
- Rejects invalid values such as zero people or negative percentages.
- Runs with Python standard library only.
AI/Codex usage: No model-powered runtime features are included in this tiny utility. AI assistance was used during development to choose a small scope, write the script, verify the CLI behavior, and prepare submission materials. Codex guided the Devpost plugin workflow, created the Python utility, ran command-line checks, and drafted the submission packet.
Testing instructions: Run from the project root with Python 3: python3 tip_splitter.py 84.50 3 --tip 18 --tax 8.875
Expected output includes: Subtotal: $84.50 Tax: $7.50 Tip: $15.21 Total: $107.21 Each pays: $35.74
Validation check: python3 tip_splitter.py 12 0
Expected output: people must be at least 1
Built With
- codex
- devpost-codex-plugin
- python
Log in or sign up for Devpost to join the conversation.