https://github.com/dmotte/cashlog
🐍 Cash flow tracker
https://github.com/dmotte/cashlog
analysis budget budgeting calculator cash csv finance flow log management money monitor monitoring package py python statistics track tracker tracking
Last synced: 8 months ago
JSON representation
🐍 Cash flow tracker
- Host: GitHub
- URL: https://github.com/dmotte/cashlog
- Owner: dmotte
- License: mit
- Created: 2024-12-13T00:26:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-02T01:43:23.000Z (9 months ago)
- Last Synced: 2025-07-02T02:34:06.113Z (9 months ago)
- Topics: analysis, budget, budgeting, calculator, cash, csv, finance, flow, log, management, money, monitor, monitoring, package, py, python, statistics, track, tracker, tracking
- Language: Python
- Homepage: https://pypi.org/project/cashlog/
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cashlog
[](https://github.com/dmotte/cashlog/actions)
[](https://pypi.org/project/cashlog/)
:snake: **Cash** flow **tracker**.
## Installation
This utility is available as a Python package on **PyPI**:
```bash
python3 -mpip install cashlog
```
## Usage
There are some files in the [`example`](example) directory of this repo that can be useful to demonstrate how this tool works, so let's change directory first:
```bash
cd example/
```
We need a Python **virtual environment** ("venv") with some packages to do the demonstration:
```bash
python3 -mvenv venv
venv/bin/python3 -mpip install -r requirements.txt
```
Now we need some **input data**. You can take a look at the tests in [`test_cli.py`](test/test_cli.py) to understand the file format and create your own CSV input file.
> **Tip**: you can **join multiple input files** that are in the same format with the following command:
>
> ```bash
> cat input-*.csv | (read -r header; echo "$header"; while read -r i; do [ "$i" = "$header" ] || echo "$i"; done)
> ```
Then we can **compute the totals**:
```bash
python3 -mcashlog --fmt-amount='{:+.2f}' --fmt-total='{:.2f}' input.csv output.csv
```
And finally display some nice **plots** using the [`plots.py`](example/plots.py) script (which uses the [_Plotly_](https://github.com/plotly/plotly.py) Python library):
```bash
venv/bin/python3 plots.py -at output.csv
```
> **Tip**: if you want to somehow **filter the data** before generating the plots, you can use the `awk` command:
>
> ```bash
> awk -F, 'NR==1 || ($2+0 >= 5 || $2+0 <= -5)' output.csv > output-filtered.csv
> ```
For more details on how to use this command, you can also refer to its help message (`--help`).
## Development
If you want to contribute to this project, you can install the package in **editable** mode:
```bash
python3 -mpip install -e . --user
```
This will just link the package to the original location, basically meaning any changes to the original package would reflect directly in your environment ([source](https://stackoverflow.com/a/35064498)).
If you want to run the tests, you'll have to install the `pytest` package and then run:
```bash
python3 -mpytest test
```