Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme for v2 #60

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
137 changes: 86 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,39 @@ Terminal dashboard to manage personal finances. Built with [hledger](https://hle
<img width="750" src="gifs/demo.gif" />
</a>

## Features
- View balance
- assets
- expenses
- revenue
- liabilities
- View reports
- income statement
- balance sheet
- View transactions
- Filter by
- account name
- start/end date
- View by period (monthly, yearly)
- Zoom in/out of accounts (change account depth)


## Installation
# Features

All *hledger* reports are viewable using Puffin. Some of them are natively supported, others are displayed in a simple scrollable view.

## View reports

Puffin supports the following reports natively:
- assets
- expenses
- revenue
- liabilities
- register
- accounts
- commodities

The following reports are also easily viewable:
- income statement
- balance sheet

## Filter reports
The data can be filtered by:
- account name
- start/end date
- displayed periodically - weekly, monthly, quaterly, yearly
- change account depth


# Installation

## Download binaries
If you just want to use it, you can download the binary from [here](https://github.com/siddhantac/puffin/releases).

## Install from source
### Pre-requisites

- [hledger](https://hledger.org/) is required for puffin to work.
Expand All @@ -44,46 +58,67 @@ Terminal dashboard to manage personal finances. Built with [hledger](https://hle
### Run demo

* Clone this repo
* Run `make start`
* Run `make debug`

### Run with your own journal file

* Build using `make build`
* Run using `./puffin`. It automatically uses the `$LEDGER_FILE` environment variable

**Custom path for the journal file**

There are 2 ways to use a custom path for the journal file.

1. Run with env var: `LEDGER_FILE=<custom_path> ./puffin`
2. Run with args: `./puffin -file <custom_path>`

**Change hledger executable path**

Run with `./puffin -exe <path_to_hledger>`

**Custom reports**

You can setup custom reports using a config file.

```
puffin -cfg config.json
* Use `make start`

or

* Run using `make build && ./puffin`

It uses your hledger setup as it is. So there is no need to setup journal files if you are already using hledger.

## Configuration

Puffin can use a config file written in json. It is not required though. Without a config file Puffin will use sane defaults.

The default config:

```json
"reports": [
{
"name": "register",
"cmd": "hledger register"
},
{
"name": "expenses",
"cmd": "hledger balance type:x"
},
{
"name": "assets",
"cmd": "hledger balance type:a"
},
{
"name": "revenue",
"cmd": "hledger balance type:r"
},
{
"name": "liabilities",
"cmd": "hledger balance type:l"
},
{
"name": "income statement",
"cmd": "hledger incomestatement"
},
{
"name": "balance sheet",
"cmd": "hledger balancesheet"
},
{
"name": "accounts",
"cmd": "hledger accounts --tree",
"locked": true,
}
]
```

See [config.debug.json](config.debug.json) for ideas.
See [config.debug.json](config.debug.json) for more ideas.


### Keys

| Key | Feature |
| --- | --- |
| <kbd>?</kbd> | toggle help (to remove) |
| <kbd>q</kbd> | quit app |
| <kbd>r</kbd> | refresh data |
| <kbd>f</kbd> | activate filters |
| <kbd>esc</kbd> | de-activate filter |
| <kbd>j/k/up/down</kbd> | navigate reports |
| <kbd>up/down</kbd> | navigate filters (when active) |
| <kbd>J/K/PgUp/PgDown</kbd> | scroll inside a report |
| <kbd>m/u/y</kbd> | monthly/quarterly/yearly report |
Show this help with `?`

![keybindings](assets/keybindings.png)
Binary file added assets/.DS_Store
Binary file not shown.
Binary file added assets/keybindings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions config.debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@
"cmd": "hledger incomestatement -f data/hledger.journal "
},
{
"name": "assets",
"cmd": "hledger balance type:a -f data/hledger.journal"
"name": "balance sheet",
"cmd": "hledger balancesheet -f data/hledger.journal "
},
{
"name": "expenses-lock",
"cmd": "hledger balance type:x",
"locked": true
"name": "expenses",
"cmd": "hledger balance type:x -f data/hledger.journal"
},
{
"name": "expenses",
"cmd": "hledger balance type:x"
"name": "assets",
"cmd": "hledger balance type:a -f data/hledger.journal"
},
{
"name": "register",
"cmd": "hledger register -f data/hledger.journal"
},
{
"name": "revenue",
Expand All @@ -28,12 +31,9 @@
"cmd": "hledger balance type:l -f data/hledger.journal"
},
{
"name": "balance sheet",
"cmd": "hledger balancesheet -f data/hledger.journal "
},
{
"name": "register",
"cmd": "hledger register -f data/hledger.journal"
"name": "expenses(locked)",
"cmd": "hledger balance type:x -f data/hledger.journal",
"locked": true
},
{
"name": "accounts",
Expand Down
Binary file modified gifs/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 5 additions & 11 deletions gifs/demo.tape
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
Set FontSize 20
Set Width 1600
Set Height 800
Set Height 1200
Set Framerate 30
Set Padding 12

Output gifs/demo.gif

Hide
Type@10ms "puffin -file data/hledger.journal"
Type@10ms "./puffin -cfg config.debug.json"
Enter
Sleep 2s

Show

Sleep 2s

Set TypingSpeed 500ms
Set TypingSpeed 200ms

Type "m"
Sleep 2s
Type "y"

Sleep 2s

Down
Expand All @@ -30,18 +29,13 @@ Sleep 2s
Down
Sleep 2s
Down
Sleep 2s
Down
Sleep 2s
Down

Sleep 2s
Type "f"
Type "assets"
Enter
Sleep 2s

Down
Backspace 4
Type "2022-05-01"
Enter
Sleep 2s

8 changes: 6 additions & 2 deletions ui/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,17 @@ var DefaultConfig = Config{
func defaultReports() []Report {
return []Report{
{
Name: "assets",
Cmd: "hledger balance type:a",
Name: "register",
Cmd: "hledger register",
},
{
Name: "expenses",
Cmd: "hledger balance type:x",
},
{
Name: "assets",
Cmd: "hledger balance type:a",
},
{
Name: "revenue",
Cmd: "hledger balance type:r",
Expand Down
2 changes: 1 addition & 1 deletion ui/table_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (t *TableGraph) plotGraph(rows []float64, legend string) string {
}
graph := asciigraph.Plot(
rows,
asciigraph.SeriesColors(asciigraph.Red),
asciigraph.SeriesColors(asciigraph.IndianRed),
asciigraph.Height(t.viewportSize.Height-3),
asciigraph.Width(t.viewportSize.Width),
asciigraph.SeriesLegends(legend),
Expand Down