dinero/
mod.rs

1//! Dinero (spanish for money) is a command line tool that can deal with ledger files. It is inspired but not a port of John Wiegley's wonderful [ledger-cli](https://www.ledger-cli.org/).
2//!
3//! Note that the crate name is ```dinero-rs``` but the executable is ```dinero```
4//!
5//! # Getting started
6//!
7//! ## The input files
8//!
9//! ```dinero``` understands ledger files, which are human-readable journal files.
10//! A journal is composed of *directives* that tell ```dinero``` about miscellaneous
11//! things like accounts, payees or commodities and *transactions*, which are each of the journal entries. A transaction looks like this:
12//!
13//! ```ledger
14//! 2021-02-28 * Flights to Rome | Alitalia
15//!     Expenses:Travel             153.17 EUR
16//!     Assets:Checking account    -153.17 EUR
17//! ```
18//!
19//! A transaction (if it doesn't include virtual postings) always has to be balanced, meaning the total amount of a transaction has to be zero. ```dinero``` knows this, so elliding some information is allowed, like so:
20//! ```ledger
21//! 2021-02-28 * Flights to Rome | Alitalia
22//!     Expenses:Travel             153.17 EUR
23//!     Assets:Checking account
24//! ```
25//! Or you can even do multi-currency, the conversion will be implicitely done. It supports unicode too, so this is valid as well:
26//!
27//! ```ledger
28//! 2021-02-28 * Flights to Rome | Alitalia
29//!     Expenses:Travel             153.17 €
30//!     Assets:Checking account     $-180
31//! ```
32//!
33//! ## The commands
34//!
35//! Given an input file, reports are extracted with commands, like so:
36//!
37//! ```zsh
38//! # A balance report
39//! dinero bal -f my_journal.ledger
40//!
41//! # A balance report in euros
42//! dinero bal -f my_journal.ledger -X €
43//!
44//! # Print all the registers
45//! dinero reg -f my_journal.ledger
46//! ```
47
48extern crate pest;
49#[macro_use]
50extern crate pest_derive;
51
52mod app;
53pub mod commands;
54mod error;
55pub mod filter;
56mod list;
57pub mod models;
58pub mod parser;
59
60pub use app::{run_app, CommonOpts};
61pub use list::List;
62#[macro_use]
63extern crate prettytable;