GithubHelp home page GithubHelp logo

fdavies93 / seneca Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 10 KB

CLI tool to convert Wise transactions into Beancount format with multi-currency

Nix 3.04% Python 96.96%
accounting beancount currency finance wise

seneca's Introduction

Buy Me A Coffee

Seneca

A script to import from Wise (formerly Transferwise) CSVs to beancount format. Named after Seneca the Younger, a stoic philosopher who became wealthy by pioneering commodities trading and finance. I.e. a Wise Beancounter.

The script can successfully log multi-legged outbound transactions including currency transfers. I use it for my own small business accounting needs.

Imports from Wise Transfers CSV format. Note that this is a relatively new format and doesn't include card transactions before 2023-10-27. For that you'll need to use the older and less rich Wise Statement format, which this tool doesn't support as of 2024-02-28.

If you'd like me to support additional formats, add more options, or notice any errors, please file an issue and consider buying me a coffee.

The project is open for pull requests.

Quickstart

Git clone this repo and navigate to the folder.

python3 -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt 
python seneca.py --input wise_transactions.csv --map categories.json

Options

Note that the script prints to stdout. This is by design so that you can use > and >> to pipe into different files.

--input

The Wise transactions CSV file to import from. E.g. input/business-wise.csv

--map

A JSON file. This lets you automatically set the category of both inbound and outbound transactions to this account, which is very helpful when processing a large number of transactions. It uses the target_name and source_name columns from the Wise CSV as the key and your desired category as the key. For example:

{
  "Spotify": "Expenses:Subscriptions",
  "Acme Corp": "Income:Salary"
}

If there's no category found then the script will allocate Income:Unassigned or Expenses:Unassigned to your transactions.

--sort

A switch to decide the order in which transactions are sorted, by date. If the value is desc, outputs in descending order (most recent date first). For all other values, and by default, outputs in ascending order by date.

python seneca.py -i input/transactions.csv --sort desc

seneca's People

Contributors

fdavies93 avatar

Stargazers

Rick Lan avatar John Mee avatar Gary Peck avatar

Watchers

 avatar  avatar

seneca's Issues

[feature] Option to sort the transactions by date (asc)

The transactions are not generated in a predictable order.

Whilst I understand that date order is not a beancount requirement, it might be nice to have, perhaps as an option, or by default, to output the transactions in ascending date order.

Expected:

2022-06-10 * "Bill Buckle"
	Income:Unassigned -500.0 AUD
	Assets:Wise 500.0 AUD

2023-03-16 * "Bill Buckle"
	Income:Unassigned -3000.0 AUD
	Assets:Wise 3000.0 AUD

2023-09-27 * "TransferWise"
	Income:Unassigned -0.07 AUD
	Assets:Wise 0.07 AUD

2023-11-15 * "CROSSLINKS"
	Assets:Wise -35.0 GBP @@ 35.0 GBP
	Expenses:Unassigned 35.0 GBP

Observed:

2023-11-15 * "CROSSLINKS"
	Assets:Wise -35.0 GBP @@ 35.0 GBP
	Expenses:Unassigned 35.0 GBP

2023-09-27 * "TransferWise"
	Income:Unassigned -0.07 AUD
	Assets:Wise 0.07 AUD

2022-06-10 * "Bill Buckle"
	Income:Unassigned -500.0 AUD
	Assets:Wise 500.0 AUD

2023-03-16 * "Bill Buckle"
	Income:Unassigned -3000.0 AUD
	Assets:Wise 3000.0 AUD

[bug] Output option required but not used

The --output is a mandatory input, but is ignored.

Expected:

When I run python senca.py --input wise-transactions.csv I expected it to write the output to stdout.

Observed:

usage: seneca.py [-h] --input INPUT --output OUTPUT [--map MAP]
seneca.py: error: the following arguments are required: --output/-o

Expected:

When I run python seneca.py --input wise-transactions.csv --output foo.beancount I expected the output to be deposited into the file foo.beancount.

Observed:

The output was written to stdout, but no file was created.

Recommendation:

Drop the output parameter. As you said in the readme, if you want it to file then redirect the stdout.

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.