Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akerl/ballista
https://github.com/akerl/ballista
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/akerl/ballista
- Owner: akerl
- License: mit
- Created: 2016-04-25T00:47:51.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-07-07T22:41:03.000Z (over 1 year ago)
- Last Synced: 2024-10-31T14:47:41.036Z (8 days ago)
- Language: Ruby
- Homepage:
- Size: 47.9 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - akerl/ballista - (others)
README
ballista
=========[![Gem Version](https://img.shields.io/gem/v/ballista.svg)](https://rubygems.org/gems/ballista)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/akerl/ballista/build.yml?branch=main)](https://github.com/akerl/ballista/actions)
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)Helper for projecting based on [Ledger](http://www.ledger-cli.org/) format.
## Usage
To make a new Projection object, use `Ballista.new(entries: my_config)`. my_config should be a hash of projection entries, like this:
```
- name: Pay Check
when:
- 15
- 30
actions:
Expenses:Taxes:federal_income: $729.26
Expenses:Taxes:va_income: $215.14
Expenses:Taxes:social_security: $299.46
Expenses:Taxes:medicare: $70.04
Assets:Checking:simple: $2739.10
Assets:401K:Trad:work: $772.00
Income:Salary:work: $-4825.00
- name: Automatic transfer to Savings
when: 2
actions:
Assets:Savings:ally: $1000.00
Assets:Checking:simple: null
- name: Rent
when: 2
actions:
Expenses:Bills:rent: $2800.00
Assets:Checking:simple: null
```To do a projection, call `.project(start_dt, end_dt)` on your created object. The dates should be Ruby Date objects.
The returned object will be a Ledger journal, courtesy of [libledger](https://github.com/akerl/libledger). As such, you can inspect the .entries as well as use .to_s or puts to print it in ledger text file format.
## Installation
gem install ballista
## License
ballista is released under the MIT License. See the bundled LICENSE file for details.