budget

package module
v0.0.0-...-945503a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

README

Budget 2 Sheets

Go Go Report Card Dependabot Status

I created this project for automating some tasks I was doing manually when taking care of my personal finances.
Long story short, this is an ETL for tracking my expenses.
The project consists of two lambda functions : budgetcategorizer and budget2sheets
The transform part is performed by budgetcategorizer and has two main responsibilities : sanitize the expense description and assign a category to the expense.
The load part is performed by budget2sheets which is going to upload the transactions (i.e. expenses) to Google Sheets.

Overall Architecture

Architecture Diagram

Getting Started

Clone the repo inside the following directory:

~/go/src/github.com/jbleduigou/

If you want to fork the repo, replace the latest path element with your GitHub handle.

Prerequisites

You will need to have Go installed on your machine.
Currently the project uses version 1.25

Building

You will find a Makefile at the root of the project.
To run the full build and have zip file ready for AWS Lambda use:

make zip

If you only want to run the unit tests:

make test

Deployment

This project uses SAM as an Infrastructure As Code tool.
To deploy this project run the following commands:

sam build
sam deploy --guided

Improvements / Remaining Work

Configuration

Configuration in this application is based on the concepts exposed by The Twelve Factor App.
The idea is to strictly separate config from code by using environment variables.
Please read the page on 12 Factor Configuration for more details.

Environment Variables

The following environment variables should be declared within you lambda:

Name Description Sample Value
GOOGLE_ACCESS_TOKEN OAuth 2.0 to Access Google APIs Swac9MxkndN1elrl3y7Gk6XWizKC97gs48eJ3p7O
GOOGLE_CLIENT_ID OAuth 2.0 to Access Google APIs 769149424942-sUsY928FXCeQB15Dpot0.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET OAuth 2.0 to Access Google APIs Swac9MxkndN1elrl3y7G
GOOGLE_PROJECT_ID OAuth 2.0 to Access Google APIs budget2sheets-633863
GOOGLE_REFRESH_TOKEN OAuth 2.0 to Access Google APIs XgukkG2720EZOZuiYiHZ
GOOGLE_SPREADSHEET_ID ID of spreadsheet to be populated 6JIJnDjHKcXwF9EhCTPLp0BJiZ03tMPvbVn36sj4
GOOGLE_SPREADSHEET_RANGE Range of cells where data should be appended Suivi Dépenses Janvier!A2:F2

Project Structure

The project structure was inspired by the project Go DDD.
The entry point is located in folder cmd/budgetcategorizer.
What it does is instantiating all the dependencies for the command.
The business logic was separated by concerns and placed in dedicated folders.
Interfaces were introduced to avoid tight coupling and therefore facilitate unit testing (amongst other benefits).

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

  • Jean-Baptiste Le Duigou - Initial work - jbleduigou

See also the list of contributors who participated in this project.

License

Licensed under the Apache License, Version 2.0.
See LICENSE.txt for more details.
Copyright 2020 Jean-Baptiste Le Duigou

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction struct {
	Date        string
	Description string
	Comment     string
	Category    string
	Value       float64
}

Transaction is a transaction in the budget (purchase, refund).

func NewTransaction

func NewTransaction(date string, description string, comment string, category string, value float64) Transaction

NewTransaction creates a transaction.

Directories

Path Synopsis
cmd
budget2sheets command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL