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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file hledger-utils-1.14.0.tar.gz.

File metadata

  • Download URL: hledger-utils-1.14.0.tar.gz
  • Upload date:
  • Size: 197.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for hledger-utils-1.14.0.tar.gz
Algorithm Hash digest
SHA256 d4fcd345ccae05ef62d3d21337cd6173af9ef3d919ffd9e7650a10ba31392486
MD5 e2eac5147b36d0ab6354ae6084cbb67d
BLAKE2b-256 9898f33477595ad817096f043bcd5ba4e19e300e6ea1cd8f51f0369dd72af8f6

See more details on using hashes here.

File details

Details for the file hledger_utils-1.14.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hledger_utils-1.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80f60617ea5f8ae6ca8031555ce01fc90e7ec90d0050e9a1c2d6ec70323e5d11
MD5 8ddf28975ab3032c44f94e593cd68f3c
BLAKE2b-256 c9c069f1ed350d88b38e5bb478273cb8673595222dfa5f2d905fa4a9e8e13ce4

See more details on using hashes here.

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