/hledger-influxdb-exporter

Export a hledger journal's transactions to an InfluxDB instance

Primary LanguageHaskellOtherNOASSERTION

Hledger InfluxDB Exporter

This little tool exports all the transactions of a local hledger journal to an arbitrary InfluxDB instance. The source code is an adapted version of the contents presented in this article by Michael Walker.

Requirements

  • A Haskell development environment
    • cabal 3.10.1.0
    • GHC 9.6.5
    • GHCup 0.1.20.0
  • An InfluxDB (version 1.x) server
  • A local hledger journal file
  • A LEDGER_FILE environment variable pointing to the journal

Limitations

  • Currently this tool only handles journals using as currency. However, this may be changed by replacing in Exporter.hs with your desired currency

Setup

Make sure you have Haskell installed, preferrably using GHCup.

  1. Navigate to the project directory in your terminal
  2. Run cabal build
  3. Copy .env.example to the build output directory
    cp .env.example ./dist-newstyle/build/x86_64-windows/ghc-9.6.3/hledger-influxdb-exporter-0.1.0.0/x/hledger-influxdb-exporter/build/hledger-influxdb-exporter/.env
    
  4. Modify the .env file to point to your InfluxDB server
  5. Run the application

Tasks

  • Make currency configurable
  • Properly handle transactions without description
  • Be able to deal with multi currency journals