Skip to main content

Utilities enhancing hledger

Project description

coverage report pipeline status REUSE status PyPI version Downloads

🛠️ hledger Utilities

This Python package extends hledger the plaintextaccounting tool with some utilities.

✨ Features Added to hledger

hledger edit ...: 📝 Editing hledger Transactions in your $EDITOR

# Opens your EDITOR (or VISUAL) with only transactions in € that have a Berlin tag
# You can modify them as usual, if you save and quit the editor, the changes will be
# applied to the appropriate files
hledger edit cur:€ tag:location=Berlin

# Opens your EDITOR with all transactions
hledger edit

# If you don't have LEDGER_FILE set, you need to specify a journal file as usual:
hledger edit -f journal.hledger

# More examples and explanations:
hledger edit --help

This should work with pretty much any hledger query, just substitute hledger balance or hledger register etc. with 'hledger edit'. This is a neat way of quickly editing transactions you were just inspecting.

🎥 Check this screencast below to see hledger edit in action:

asciicast

hledger plot ...: 📈 Plotting charts of hledger queries

# Open an interactive line chart of your assets with forecast (if available) and also save it as PNG
hledger plot -- balance  ^Assets --daily --exchange=USD --historical --forecast -o assets.png

# Help, examples and configuration options (renaming, inverting, summing, styling, etc..)
hledger plot --help

📈 Example plot:

hledger plot

Note: Currently, only the balance command output can be plotted. hledger-plot has many options, check them out with hledger-plot --help, most notably:

  • --summing and --meaning columns by regex
  • --multiplying a column with a factor
  • Filtering columns with --drop and --only regexes
  • --resampleing to a different interval, e.g. 10 days with --resample 10d
  • adding --trends to (specific time periods of) columns and show slope in legend at configurable interval
  • grouping e.g. by quarter with --groupby quarter to compare quarters
  • --styleing depending on the account name

Consider converting your amounts to one currency (e.g. -X€) and using --historical. --stacked --barplots are also available.

See the doc/ folder for examples of hledger-plot.

📦 Installation

# Install this package from PyPI:
pipx install hledger-utils

# Install the latest development version:
pipx install git+https://gitlab.com/nobodyinperson/hledger-utils

# Install from the repository root
git clone https://gitlab.com/nobodyinperson/hledger-utils
cd hledger-utils
pipx install .

The previous commands will install hledger-edit and hledger-plot to ~/.local/bin/ by default. Make sure that directory is in your PATH.

This package is also available in the AUR as hledger-utils (latest release) and hledger-utils-git (development version).

📝 Changelog

Version tags (v*) are annotated with a summary of changes. You can view them for example on GitLab or from the repository with this command:

git tag -l 'v*' -n99 --sort=-version:refname --format='%(color:green)%(refname:strip=2)%(color:yellow) (%(color:cyan)%(creatordate:format:%a %b %d %Y)%(color:yellow))%0a%(color:magenta)==========================%0a%0a%(color:yellow)%(contents:subject)%(color:normal)%0a%0a%(contents:body)'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hledger-utils-1.14.0.tar.gz (197.7 kB view hashes)

Uploaded Source

Built Distribution

hledger_utils-1.14.0-py3-none-any.whl (48.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page