-
-
Notifications
You must be signed in to change notification settings - Fork 370
Description
Here's an overview issue to collect wishes - things people sometimes want - for CSV rules.
All of these are at least worth considering, and research and development is welcome.
Some of these have their own issue numbers, not yet linked.
- add text to hledger fields (particularly comment fields)
- save the original csv record in a comment field
- comparison operators for dates
- comparison operators for amounts
- nested ifs
- comment lines anywhere
- end of line comments anywhere (?)
- text transforms: substring, capitalisation, regex replace..
- amount transforms: arithmetic operations
- more control over archive file names, archiving policies
- generate multiple journal entries from one record
- generate one journal entry from multiple records
- a better story for when and how to switch between or combine hledger csv rules and a real programming language.
- include csv files in a journal file
- include rules files in a journal file
- better docs / examples / getting started experience
About CSV rules
hledger's CSV rules format started out as a minimal config format that non-programmers could use to describe a CSV file's fields and make it readable. This goal remains in effect, but by now rules files are also a domain specific language not just for describing the CSV but also
- how to fetch/produce/archive the CSV
- how to interpret complex, partial, possibly wrong CSV records
- how to assign accounting categories based on simple or complex conditions
- how to generate custom, sometimes complex, valid journal entries.
They are intentionally not a turing-complete programming language. When there's a need they don't cover, we recommend to replace or complement them with one of those. Eg as a pre-filter before rules processing. (Because some things are easier to do in a real programming language, and some other things are easier and more robust to do in the rules file.) Nevertheless, advanced csv rules usage is a kind of programming.