Code Monkey home page Code Monkey logo

budgetwarrior's Introduction

budgetwarrior 1.1.0

Linux Build

Mac OS Build

Sonar Build

SonarSource analysis

MIT License

Simple command line utility to helps keeping track of your expenses and the state of your budget.

image

Personal accounting method

Not everyone manages its money the same way. budgetwarrior is based on my way of managing my money. It may not be adapted to everyone. I'm separating all my expenses in several "accounts" and I give each of them a certain amount of money each month.

Accounts are recipients for your expenses and earnings. They are not bank accounts, they only are logical recipients. Think of them as categories. The sum of the accounts should be equivalent to your salary.

For instance, if you have 1000$ per month, you could have three accounts:

  • Food (200$)
  • Car (300$)
  • House (500$)

That means you allow yourself to spend 200$ on food each month. Of course, some month you'll be lower or higher. And the tool will indicate you how well your accounts are doing, month by month and by year.

Features

budgetwarrior has several features:

  • Manages a set of account with a monthly limit
  • Keeps track of your expenses and earnings in each of your accounts
  • Gives you the state of your budget by month and by year
  • Keeps track of your debts
  • Manages recurring expenses that are automatically created monthly
  • Keeps track of your wishes
  • Keeps track of your current fortune

On the other hand, budgetwarrior:

  • Has no notion of bank, cash, credit card
  • Will not communicate with your ebanking tool to extract information

Starting guide -------------

The wiki contains a guide for starting using budgetwarrior: Start-Tutorial

Installation

A Gentoo ebuild is available on this overlay: https://github.com/wichtounet/wichtounet-overlay

Arch Linux packages are also available on AUR: https://github.com/StreakyCobra/aur

For other systems, you'll have to install from sources.

Build from source

A modern compiler is necessary. I am working with GCC 13 and clang 17. You need to set the $CXX variable before executing make.

Linux

The tool is developed for Linux. You need libcurl and libuuid installed on your computer to build this project.

You just have to use make to build it:

$ git clone --recursive git://github.com/wichtounet/budgetwarrior.git
$ cd budgetwarrior
$ make
$ sudo make install

If you want to install the man pages and the shell completion files, you can do so with:

$ sudo make install_extra

MacOS

MacOS support is experimental. Using CMake and Homebrew, you can build from sources.

  1. First, install Xcode compiler toolchain via xcode-select --install if needed.
  2. Use Homebrew to install required dependencies. Download and install brew from https://docs.brew.sh if you don't already have it:

    $ brew install cmake
    $ brew install git
    $ brew install openssl

Now build using the provided script after cloning repository:

$ git clone --recursive git://github.com/wichtounet/budgetwarrior.git
$ cd budgetwarrior
$ ./build_macos.sh

To install the resulting, compiled program:

$ cd ./build && make install

Windows

If there is some interest on using it on Windows, it should not take too much work to port it to Windows. Just let me know (or make a Pull Request with the changes ;) ). .

Usage

Man pages and ZSH/Bash completions are also available.

The executable is named 'budget' and allows to perform all the commands.

Use:

$ budget help

Or:

$ man budget

if you have installed the man pages to see all the available commands.

If you want to use the web interface, you will need to use another project: https://github.com/wichtounet/budgetwarrior_web

Contributors

Read AUTHORS

Release Notes

Read ChangeLog

Contribute

The project is open for any kind of contribution : ideas, new features, bug fixes, tests, ...

If you want to contribute to this project, you can contact me by email or via my website. You can also directly fork the project and make a pull request.

Troubleshooting

Please consider using Github issues tracker to submit bug reports or feature requests. You can also contact me via my website.

License

This project is distributed under the MIT License. Read LICENSE for details.

budgetwarrior's People

Contributors

ferologics avatar obikeahloa avatar robromano avatar shirobachi avatar strixcode avatar wichtounet avatar xeruf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

budgetwarrior's Issues

Can't build from source.

Reproduce

  • sudo docker run -it archlinux /bin/bash
  • pacman -Syu
  • pacman -S git base-devel cmake clang util-linux openssl
  • git clone --recursive git://github.com/wichtounet/budgetwarrior.git

Error_01

Cloning into '/opt/budgetwarrior/fmt'...
error: cannot run ssh: No such file or directory
fatal: unable to fork
fatal: clone of '[email protected]:fmtlib/fmt.git' into submodule path '/opt/budgetwarrior/fmt' failed
Failed to clone 'fmt'. Retry scheduled
Cloning into '/opt/budgetwarrior/include/cpp_utils'...
remote: Enumerating objects: 741, done.
remote: Total 741 (delta 0), reused 0 (delta 0), pack-reused 741
Receiving objects: 100% (741/741), 122.54 KiB | 606.00 KiB/s, done.
Resolving deltas: 100% (484/484), done.
Cloning into '/opt/budgetwarrior/loguru'...
error: cannot run ssh: No such file or directory
fatal: unable to fork
fatal: clone of '[email protected]:emilk/loguru.git' into submodule path '/opt/budgetwarrior/loguru' failed
Failed to clone 'loguru'. Retry scheduled
Cloning into '/opt/budgetwarrior/make-utils'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 219 (delta 3), reused 7 (delta 2), pack-reused 210
Receiving objects: 100% (219/219), 30.11 KiB | 593.00 KiB/s, done.
Resolving deltas: 100% (125/125), done.
Cloning into '/opt/budgetwarrior/fmt'...
error: cannot run ssh: No such file or directory
fatal: unable to fork
fatal: clone of '[email protected]:fmtlib/fmt.git' into submodule path '/opt/budgetwarrior/fmt' failed
Failed to clone 'fmt' a second time, aborting

Then we try:

  • cd budgetwarrior
  • make

Error_02

Makefile:81: make-utils/cpp-utils-finalize.mk: No such file or directory make: *** No rule to make target 'make-utils/cpp-utils-finalize.mk'. Stop.

make-utils folder is empty (only a .git folder inside)

About building from source instruction:
A modern compiler is necessary. I am working with GCC 9.3. You need to set the $CXX variable before executing make.

$CXX should be set by make as it's a predefined variable but even after overriding the variable the error is in the make-utils folder.

openssh

I've installed pacman -S openssh and got this:

"Error_03"

Warning: Permanently added 'github.com,140.82.121.3' (RSA) to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:fmtlib/fmt.git' into submodule path '/opt/budgetwarrior/fmt' failed
Failed to clone 'fmt'. Retry scheduled
Cloning into '/opt/budgetwarrior/include/cpp_utils'...
remote: Enumerating objects: 741, done.
remote: Total 741 (delta 0), reused 0 (delta 0), pack-reused 741
Receiving objects: 100% (741/741), 122.54 KiB | 603.00 KiB/s, done.
Resolving deltas: 100% (484/484), done.
Cloning into '/opt/budgetwarrior/loguru'...
Warning: Permanently added the RSA host key for IP address '140.82.121.4' to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:emilk/loguru.git' into submodule path '/opt/budgetwarrior/loguru' failed
Failed to clone 'loguru'. Retry scheduled
Cloning into '/opt/budgetwarrior/make-utils'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 219 (delta 3), reused 7 (delta 2), pack-reused 210
Receiving objects: 100% (219/219), 30.11 KiB | 550.00 KiB/s, done.
Resolving deltas: 100% (125/125), done.
Cloning into '/opt/budgetwarrior/fmt'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:fmtlib/fmt.git' into submodule path '/opt/budgetwarrior/fmt' failed
Failed to clone 'fmt' a second time, aborting

Help :D

What am I missing? Before the docker I've tried it on my main machine (Manjaro) from source and it didn't work (same problem) but using AUR it does work perfectly.

Access denied on install to SIP protected directory

The $ sudo make install command is exiting with an error with install: /usr/bin/budget: Operation not permitted.

Since macOS El Capitan (bye bye OS X) we have System Integrity Protection (SIP) aka rootless. The relevant part of SIP here is:

System Integrity Protection protects system files and directories that are flagged for protection. This happens either by adding an extended file attribute to a file or directory, by adding the file or directory to /System/Library/Security/rootless.conf or both. Among the protected directories are: /System, /bin, /sbin, /usr (but not /usr/local).

If it is impossible to modify /usr, but not /usr/local, then the prefix should be set to /usr/local?

Unable to make

I have been unable to make from source or install via the AUR. I should have the dependencies, I've used taskwarrior for a while. If you see what I'm doing wrong please let me know. I've attached a screenshot of the output I get when I run make.

Thank you!
pic-selected-210630-1400-38

Support for fractional shares

I see that asset_share.shares is an int64. While this generally makes sense intuitively, this means that it becomes hard to use budgetwarrior for share vesting schemes.

In my case, my employer awards me for instance 20 shares of restricted stock, but after withholding taxes, my broker credits me 18.84 shares. So technically if I wanted to automatically track share awards, I would want to to log the acquisition of 18.84 shares, heh.

(And 40 becomes.... 37.681 ? for fascinating rounding reasons I suppose)

For curiosity, I wondered if there's an industry standard on what makes sense, but alas I'm not sure there is anything out there. Fascinating :-)

Compile error: src/pages/accounts_pages.cpp

Hi @wichtounet !

I am compiling on MacOS as way you have suggested. I get this error:

-e [release_debug] Compile src/pages/accounts_pages.cpp
error: unable to open output file
      'release_debug/src/pages/accounts_pages.cpp.o':
      'No such file or directory'
1 error generated.
make: *** [release_debug/src/pages/accounts_pages.cpp.o] Error 1

Could you please help me with this?

Unable to load the configuration (/.local/share/budget)

I'm really interested in exploring this software but I'm getting the below error on Manjaro 23.0.4

The folder "/.local/share/budget" does not exist. Would like to create it [yes/no] ? yes
[main thread ] budget.cpp:198 ERR| Unable to load the configuration

I get the same result for "yes", and yes/no also give the same results whether I install from the AUR or compile from source.

I noticed from the documentation that the program should be looking for .budget under my home folder. Is there something either in the code or what I'm doing that would cause it to be looking for the wrong folder?

fatal error: 'openssl/ssl.h' file not found

Hey, I followed the install instructions up to the make and got this: fatal error: 'openssl/ssl.h' file not found

Full log ⚠️:

~/P/budgetwarrior> make
-e [release_debug] Compile src/accounts.cpp
src/accounts.cpp:464:12: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
    return std::move(accounts);
           ^
src/accounts.cpp:464:12: note: remove std::move call here
    return std::move(accounts);
           ^~~~~~~~~~        ~
1 warning generated.
-e [release_debug] Compile src/api.cpp
In file included from src/api.cpp:17:
In file included from include/http.hpp:12:
cpp-httplib/httplib.h:63:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
         ^~~~~~~~~~~~~~~
1 error generated.
make: *** [release_debug/src/api.cpp.o] Error 1
~/P/budgetwarrior>

Any idea what I need to change on my computer?

Clang support

Howdy,

Just dropping this here, I imagine this is possibly low priority and I understand ;-)

  • Because of your use of views::as_rvalue and fold, both of which are not supported by Clang, budgetwarrior is currently gcc-only.
  • make-utils could probably use a bit of love, e.g. use_cpp23 definitely does not work for clang, which expects -std=c++2b for 23.
  • If we wanted to add / keep support, I suppose it would make sense to add a workflow testing builds on clang too.

For now I'm fine just not caring / using published Docker images.

Getting rid of folds is feasible with a bit more verbosity and I had a bit of fun with this already. I'm not sure what to do with as_rvalue, I don't have familiarity with this idiom yet :-)

Cheers!

budget server command doesn't work

Linux Mint 21 Cinnamon
Hi! I have installed Budgetwarrior. But through installation works command:
$ git clone --recursive https://github.com/wichtounet/budgetwarrior.git
It is instead of "$ git clone --recursive git://github.com/wichtounet/budgetwarrior.git".
When "make" I have needed to install:
build-essential, libssl-dev and uuid-dev.
For installation of man page I was needed to add some new directories at /usr/local/:
/usr/local/share/man/man3,
/usr/local/etc/bash_completion.d
/usr/local/share/zsh/site-functions.
When:
$ budget server
Unhandled command "server"
Then:
$ budget gc
Unhandled command "gc"
Also doesn't work:
budget versioning save
budget versioning sync
budget sync .
If budget server doesn't works, something goes wrong. So this needs to be corrected.
In correspondence with the author, he advised me to install the previous version of his program with git tag 1.0.1.
Why it was needed to write about this feature in the description to the program then? The terminal is pretty enough without budget server feature by the way. The description of this feature could be just removed if it doesn't work. But if there is a description, then I want everything to work.
So I followed the author's advice and tried to install another version of this program through git.
Then I did next steps. I entered at my unpacked Budgetwarior folder at first. Then to see git tags:
$ cd budgetwarrior
$ git tag
........
1.0.1
1.0.2
The version of the programm with tag 1.0.1 presents. Okay. Then to install the version for tag 1.0.1:

$ git checkout 1.0.1

Then I was needed to delete "doctest,fmt, loguru" directories at ".git/modules/" because they were "not empty" as was written at an error message after this command. Then:
$ make
make: *** No rule to make target 'include/logging.hpp', needed by 'release_debug/src/accounts.cpp.o'. Stop.
So, the version 1.0.1 of Budgetwarior for git tag 1.0.1 cannot be installed.
About my compiler for Budgetwarior. To see it I opened the binary file "budget" with "strings" command аnd redirected its output to a text file:
$ strings -a /usr/local/bin/budget > budget-bin.txt
Then I found there this line:
GCC: (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
About my $CXX variable. For what reasons and how I must to set it before installation of the program is unclear for me. But I can see the $CXX variable setted with my make-command:

$ make -p -f /dev/null | grep CXX
make: *** No targets.  Stop.
LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
CXX = g++
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c

Error on make step

Hello,
i follow the step to compile the project and i have an error on the make step:

make
[release_debug] Compile src/accounts.cpp
[release_debug] Compile src/api.cpp
[release_debug] Compile src/args.cpp
[release_debug] Compile src/asset_classes.cpp
[release_debug] Compile src/assets.cpp
[release_debug] Compile src/asset_shares.cpp
[release_debug] Compile src/asset_values.cpp
[release_debug] Compile src/budget.cpp
[release_debug] Compile src/budget_exception.cpp
[release_debug] Compile src/compute.cpp
[release_debug] Compile src/config.cpp
[release_debug] Compile src/console.cpp
[release_debug] Compile src/console_writer.cpp
[release_debug] Compile src/currency.cpp
[release_debug] Compile src/data_cache.cpp
[release_debug] Compile src/data.cpp
[release_debug] Compile src/date.cpp
[release_debug] Compile src/debts.cpp
[release_debug] Compile src/earnings.cpp
[release_debug] Compile src/expenses.cpp
[release_debug] Compile src/fortune.cpp
[release_debug] Compile src/guid.cpp
src/guid.cpp:14:10: erreur fatale: uuid/uuid.h : Aucun fichier ou dossier de ce type
   14 | #include <uuid/uuid.h>
      |          ^~~~~~~~~~~~~
compilation terminée.
make: *** [Makefile:25: release_debug/src/guid.cpp.o] Error 1

Have you already get this error ?

Infinite error loop when adding a new asset

When I use budget asset add and hit Enter after typing the name of the new asset, I get the error message The distribution must account to 100% infinitely printing until I Ctrl+C. Then I get the below messages:

Loguru caught a signal: SIGINT
Stack trace:
11      0x55c241007355 budget(+0x26355) [0x55c241007355]
10      0x7ffbb028fd8a __libc_start_main + 138
9       0x7ffbb028fcd0 /usr/lib/libc.so.6(+0x27cd0) [0x7ffbb028fcd0]
8       0x55c241006080 budget(+0x25080) [0x55c241006080]
7       0x55c241064913 budget(+0x83913) [0x55c241064913]
6       0x55c241053d3f budget(+0x72d3f) [0x55c241053d3f]
5       0x7ffbb06a6032 std::ostream::put(char) + 226
4       0x7ffbb02ec353 _IO_file_overflow + 259
3       0x7ffbb02ebe19 _IO_do_write + 25
2       0x7ffbb02eb014 /usr/lib/libc.so.6(+0x83014) [0x7ffbb02eb014]
1       0x7ffbb02ecd4d _IO_file_write + 45
0       0x7ffbb036c034 write + 20
2023-10-27 09:49:16.048 (   2.649s) [main thread     ]                       :0     FATL| Signal: SIGINT

I may be missing something required to correctly set up assets, but in either case perhaps the application could exit after printing the error once.

Value "monthly" is not accepted as recurrency type

Hi!

My problem is that the seemingly correct recurrence value monthly is not accepted. Consider the following session:

~$ budget account
Accounts 

ID Name    Amount     Part   
1  General 2000000.00 100,00%
   Total   2000000.00        

~$ budget recurring add
Account []: General
Name []: Test
Amount [0.00]: 100
Recurrence []: monthly
This value can only be one of these values [monthly, weekly]
Recurrence [monthly]:

I've compiled budgetwarrior (revision 15712d0) from source on Ubuntu 23.10. Is there anything I can do for debugging it further?

Segmentation faults in some menu links

While navigating around the program without having added any data, monthly overview gives a segmentation fault. Other links with Seg faults are aggregate year, aggregate month, asset graph.

Could not make install on Linux 20.04 LTS

Hi, I'm new to this and I installed the following:

  • libssl-dev
  • uuid-dev
  • uuid-runtime

Then performed make apparently successfully, and I have the "budget" in the bin folder.

This is the code error:

Installation of budgetwarrior
=============================

install budget.man /usr/local/share/man/man3/budget.3
install: cannot create regular file '/usr/local/share/man/man3/budget.3': No such file or directory
make: *** [Makefile:41: install] Error 1

Thank you!

Understanding the design

Hi @wichtounet !

First of all, Thankyou for the great tool.

I was trying to understand your code and how it is designed. It is little complicated to understand. I was just wondering if you have any block diagram / or any pointers to design patterns on which the design of this system is based.

Any help would be great. Thankyou once again.

No such file or directory "bash_completion.d"

The bash completion install directory does not exist on macOS at it's specified path /etc/bash_completion.d. It lives in /usr/local/etc/bash_completion.d/

👉 The final install path should then be $(prefix)/etc/bash_completion.d/budget.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.