Giter Site home page Giter Site logo

teledger's Introduction

Teledger

Service which should combine powerful double-entry accounting system ledger, with reliability of a Git as a Ledger file storage, and convenience of data entry using Telegram and OpenAI LLM.

How It Works

Teledger is a Telegram bot service that manages Plain-Text Accounting files stored in a Git repository. It provides a convenient way to add transactions on the go using natural language. Pro ledger-cli users can still manually edit Ledger files using a text editor and ledger-cli utility for complex transactions or other changes where the bot interface may not be suitable.

Process Overview

  • Initiate Transaction: You send a message to Teledger describing the transaction.
  • Data Extraction: Teledger clones your Git repository and extracts necessary information such as available accounts and commodities from the Ledger files.
  • Generate and Validate Transaction: Teledger constructs a prompt and consults ChatGPT to generate a new transaction entry. This transaction is validated against the data in your Ledger repository to ensure accuracy.
  • Commit Changes: Once the transaction passes validation, it is committed and pushed back into the repository, updating your financial records automatically.

Ledger Template Repository

A template repository is available to help set up a new Ledger project.

Configuration

Service Configuration

Configure the service by setting the following environment variables or directly passing them as command-line arguments:

  • Telegram:

    • --telegram.token=, $TELEGRAM_TOKEN - Telegram bot token.
  • GitHub:

    • --github.url=, $GITHUB_URL - GitHub repository URL.
    • --github.token=, $GITHUB_TOKEN - Fine-grained personal access tokens for the repository with RW Contents scope.
  • OpenAI:

    • --openai.token=, $OPENAI_TOKEN - OpenAI API token.

Ledger File Configuration

The teledger.yaml configuration file may be placed in the root of your Ledger project repository. It includes settings specific to your ledger environment. Here is the structure of the expected YAML file:

  • mainFile: Specifies the main ledger file name, default is main.ledger.
  • strict: Boolean to allow or disallow non-existing accounts and commodities.
  • promptTemplate: Template for generating prompts, optional.
  • reports: Array of report configurations where each report includes:
    • title: Description of the report.
    • command: Ledger-cli command array to generate the report.

Example configuration in teledger.yaml:

strict: true
reports:
  - title: Expenses This Month
    command: [bal, ^Expenses, --cleared, --period, "this month", -X, EUR]
  - title: Expenses Last Month
    command: [bal, ^Expenses, --cleared, --period, "last month", -X, EUR]
  - title: ๐Ÿ’ถ Assets
    command: [bal, ^Assets]

Demo

TODO

Deploment

A Docker image for Teledger is available at Docker Hub.

Development

Create .env.dev by copying .env.example and fill in the values.

cp .env.example .env.dev

Source the .env.dev file to set the environment variables

source .env.dev

Start the service

go run app/main.go

teledger's People

Contributors

mput avatar

Stargazers

Evgeny Mukha avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.