A simple Ledger CLI implementation in Python.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
Ledger is a powerful, double-entry accounting system that is accessed from the UNIX command-line. This may put off some users, as there is no flashy UI, but for those who want unparalleled reporting access to their data, there really is no alternative.
Here are some of the features of Ledger which set it apart from other accounting systems:
-
Ledger never creates or modifies your data. Your entries are kept in a text file that you maintain, and you can rest assured, no automated tool will ever change that data.
-
The amount of data required by Ledger is minimal. It figures out from looking at your data what you mean by it and how you want it reported back to you. Accounts are created as they appear; currencies are created as they’re referenced. Anywhere that a value can be calculated, you can leave it out.
-
Ledger is a double-entry accounting tool, meaning that all entries must balance. If an entry does not balance, it will cause an error and the report will not be generated. Ledger is always checking the accuracies of your entries at every run; you won’t ever run into problems with “unaccounted” sums in an account.
-
Ledger is 100% currency-agnostic. You can store multiple currencies in any account, convert between them, or even pay in one currency and receive change in another.
To get a local copy up and running follow these simple example steps.
Prior to installing and downloading the files you will need to have Python installed. You can find the installation instructions here. Or run the following command to install Python.
brew install python
- Clone the repo
git clone https://github.com/trujillo9616/BreakableToy.git
- Install packages
pip3 install requirements.txt
- Run the project
python3 ledgertruji.py --help
This small implementation of the Ledger CLI in Python supports the following commands and flags:
REQUIRED FLAG:
- File: Read FILE as a ledger file.
python3 ledgertruji.py -f FILE
REQUIRED COMMAND (Only enter one of the following):
- Print: The print command prints out ledger transactions in a textual format that can be parsed by Ledger. They will be properly formatted, and output in the most economic form possible.
python3 ledgertruji.py -f FILE print
- Register: The register command displays all the postings occurring in a single account, line by line. The output from register is very close to what a typical checkbook, or single-account ledger, would look like. It also shows a running balance. The final running balance of any register should always be the same as the current balance of that account.
python3 ledgertruji.py -f FILE {reg or register}
- Balance: The balance command reports the current balance of all accounts. If an account contains multiple types of commodities, each commodity’s total is reported separately.
python3 ledgertruji.py -f FILE {bal or balance}
OPTIONAL FLAGS:
- Sort: Sort the register or print report based on the date the postings were made or the comment. The balance command does not support the sort flag.
python3 ledgertruji.py -f FILE command --sort {d or c}
python3 ledgertruji.py -f FILE command --price-db FILE CURRENCY
List of planned features:
- Filter results based on a regex input
- Multiple reports
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Adrian Trujillo - @trujillo9616
Project Link: https://github.com/trujillo9616/BreakableToy
- Staff members
- My mentors for their guidance and support
- Jorge Garcia for his support and providing me resources that allowed me to develop the project