Skip to content

trujillo9616/LedgerTruji

Repository files navigation

Contributors Language Repo Size Last Commit MIT License LinkedIn Medium Twitter


Logo

Ledgertruji

A simple Ledger CLI implementation in Python.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

What is Ledger?

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.

Built With

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

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

Installation

  1. Clone the repo
    git clone https://github.com/trujillo9616/BreakableToy.git
  2. Install packages
    pip3 install requirements.txt
  3. Run the project
    python3 ledgertruji.py --help

(back to top)

Usage

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
Print Function
  • 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}

Register Function

  • 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}

Balance Function

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}
Sort by date
Sort by comment
- Price-DB: Use FILE for retrieving stored commodity prices. Display values in terms of the given currency or commodity. The specified currency or commodity must be in the price-db.
python3 ledgertruji.py -f FILE command --price-db FILE CURRENCY
Price DB Function to $US
Price DB Function to BTC

(back to top)

Roadmap

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).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Adrian Trujillo - @trujillo9616

Project Link: https://github.com/trujillo9616/BreakableToy

(back to top)

Acknowledgments

  • 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

(back to top)

About

A simple Ledger CLI Python Implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages