Money & Payments ยท zero-dependency ยท MIT

larzsplit

Split a bill fairly, down to the last cent.

Uses the largest-remainder method so every split reconciles exactly - leftover cents go to the largest fractional shares, never dropped or invented. Bills can be itemized with each line shared by a different subset of people, and tax and tip are allocated proportionally to what each person ordered.

larzscript pkg install split
View on GitHub →Learn the stack

What you get

Try it

import "split" as billsplit
print(billsplit.evenly(1000, 3))
print(billsplit.proportional(1000, [1, 1, 2]))
let bill = billsplit.itemized([{"amount": 1200, "sharers": ["a","b"]}, {"amount": 600, "sharers": ["a","b","c"]}], 825, 1500)
print(bill["total"])
Output
[334, 333, 333]
[250, 250, 500]
2218

Why it's in the Larz Stack

larzsplit is a real Larzscript package (larzscript pkg install split) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.