Who owes whom how much money
Project description
wowhmm
Who owes whom how much money?
Installation
pip install wowhmm
Usage
You first provide a list of who spent how much on whom.
In the example below, Alice spent $349.95 on a BnB for everyone.
To figure out the net amount owed to and from each person, call tabulate to return a pandas.DataFrame.
>>> from wowhmm import Ledger
>>>
>>> ledger = Ledger(
... [
... ("Alice", 349.95, ["Alice", "Bob", "Carol", "Dan"]), # BnB
... ("Bob", 68.42, ["Alice", "Dan"]), # Alcohol
... ("Bob", 42.02, ["Alice", "Bob", "Carol", "Dan"]), # Groceries
... ("Dan", 72.48, ["Alice", "Bob", "Carol", "Dan"]), # Transportation
... ("Carol", 28.98, ["Carol", "Dan"]), # Movies
... ]
... )
>>>
>>> ledger.tabulate()
Alice Bob Carol Dan
Alice 0.00 -42.77 -87.49 -69.37
Bob 42.77 0.00 -10.51 -26.60
Carol 87.49 10.51 0.00 3.63
Dan 69.37 26.60 -3.63 0.00
tabulate rounds each value to the penny.
With row headers being who and column headers being whom, the data is the amount who owes whom.
A value of 0 means no money is owed.
A negative value means that who is actually owed whom by that absolute value.
In the example above, Bob owes Alice $42.77.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wowhmm-0.1.5.tar.gz.
File metadata
- Download URL: wowhmm-0.1.5.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f6268e337291ecff316bf3dd3a4f0e74279f316a1bc0f2fb23d89d152523553
|
|
| MD5 |
628fc89d42fd8094a5af583c9e717efa
|
|
| BLAKE2b-256 |
7ff5a050696c82d56945045e64256241a0dca1165062d92204e4d98175087b9c
|
File details
Details for the file wowhmm-0.1.5-py3-none-any.whl.
File metadata
- Download URL: wowhmm-0.1.5-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55f1691ac97147bcaf86f0e9a530ded4f3c238148cb114cdd12cc1360ed73d0c
|
|
| MD5 |
e2d1f7011a9758e38ec29867c46d6e01
|
|
| BLAKE2b-256 |
eff182681092ff9db865e417d8c7cf666233cb9a4c5234be8ffddc5efe82867c
|