Skip to main content

PyBudgetPlot

CI/CD CI - Test
Package PyPI - Version PyPI - Python Version
Meta Hatch project code style - black linting: pylint imports - isort License - MIT

Table of Contents


Introduction

This project was inspired by the "Personal finance with Python" book.

It'll help you to get the answers to the following list of questions (and more):

  • I want to visit Greece during September, will I have saved-up enough to go?
  • I want to buy a car, but how much time do I need to save-up with my lifestyle?
    • What about if I change my current lifestyle a bit?
  • Got offered a slightly better salary than my current, should I take it or not?
    • I'll have different expenses, what's the total net-worth change then?
    • Are those 200 bucks change in salary worth the trouble at all?
    • What about if I work somewhere for smaller salary but fewer expenses too?
  • I want to lead the following lifestyle, how much money should I earn to do so?
  • Any other question concerned about how-much money you'll have on a given date.

While "some logic" from the "Personal finance with Python" book is reused,

the source-code and the contents of the produced outputs are quite different.


Overview

All the project's functionality revolves around a 'budget-definition' file.

The definition file is used for storing the budget data in YAML format.

The budget data consists of two components:

  • Period
    • Represents list of all dates that fall in the scope of the budget.
    • Defined by a start-date and an end-date values in ISO-format.
  • Events
    • Represents list of recurring events of spending or receiving money.
    • Each Event is defined by description, amount and frequency.

The definition file is used as input for the following operations:

  • Calculation of daily and cumulative totals for each date in the period.
    • The output can be saved as CSV or dynamic XLSX file that's using formulas.
  • Plotting (line-chart) graph visualization of the daily and cumulative totals.
    • The output can be saved as PNG or an interactive plotter can be opened.

Two budgets and their outputs are included in the 'examples' dir.

The difference between 1300 and 1500 salary in the long-term can be surprising.


Installation

The project can be installed from PyPI using the following commands:

# Windows - open admin-level CMD and run:
pip install pybudgetplot

# Linux / MacOS - open user-level Terminal and run:
pip3 install --user pybudgetplot

Usage

1. Init a sample budget-definition file.

# generates budget.yaml file in the current dir
budget init budget.yaml

2. Update the file as per your needs and save the changes.

3. Generate outputs in one or all of the supported formats.

# generates budget.csv, budget.png, budget.txt, budget.xlsx files in current dir
budget plot -c -p -t -x budget.yaml

CLI Commands

# ------------------------------------------------------------------------------
# see the 'budget' command help
# ------------------------------------------------------------------------------
> budget -h

    Usage: budget [OPTIONS] COMMAND [ARGS]...

      Composite CLI command for managing a 'budget-definition' file.

    Options:
      --version   Show the version and exit.
      -h, --help  Show this message and exit.

    Commands:
      init  Initialize a budget definition file with sample contents.
      plot  Plot a budget-definition .yaml file.

# ------------------------------------------------------------------------------
# see the 'budget init' command help
# ------------------------------------------------------------------------------
> budget init -h

    Usage: budget init [OPTIONS] [FILE]

      Initialize a budget definition file with sample contents.

    Options:
      -h, --help  Show this message and exit.

# ------------------------------------------------------------------------------
# see the 'budget plot' command help
# ------------------------------------------------------------------------------
> budget plot -h

    Usage: budget plot [OPTIONS] YAML_FILE

      Plot a budget-definition .yaml file.

    Options:
      -c, --csv          Write .CSV with the breakdown next to definition file.
      -p, --png          Write .PNG with the graph next to definition file.
      -t, --txt          Write .TXT with the breakdown next to definition file.
      -x, --xlsx         Write .XLSX with the breakdown next to definition file.
      -i, --interactive  Enter interactive plot mode.
      -h, --help         Show this message and exit.

# ------------------------------------------------------------------------------
# That's all folks!
# ------------------------------------------------------------------------------

License

pybudgetplot is distributed under the terms of the MIT license.

Metadata

Release files for pybudgetplot 3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybudgetplot 3.1.1
File Size Uploaded Provenance
pybudgetplot-3.1.1.tar.gz 386.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pybudgetplot 3.1.1
File Interpreter ABI Platform
pybudgetplot-3.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 403.7 kB

Release files / pybudgetplot-3.1.1.tar.gz

Download URL pybudgetplot-3.1.1.tar.gz
Size 386.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3567b4f39c4f545188ac89912b3159c739f001db8bfcd43cada89847cdffa273
BLAKE2b-256 checksum
How to use checksums
0d5d04d9a570640f445a21f814ee3197be45e6ac635d6935738c6b53d58fa52c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.0

Release files / pybudgetplot-3.1.1-py3-none-any.whl

Download URL pybudgetplot-3.1.1-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
513109376a5af9d57fa5c73af74fdd8ecbe2a66b8c4a83da386fdb405521bdeb
BLAKE2b-256 checksum
How to use checksums
22dd886f62bf1983525f5e062ef1a2991384f135b6237a830f26c2a829d946be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.0

Security for pybudgetplot 3.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page