Slide 1

Slide 1 text

Managing Personal Finances using Python Siddhant Goel  /  @siddhantgoel PyMunich October 2018

Slide 2

Slide 2 text

Let's talk about money.

Slide 3

Slide 3 text

What is my net worth?

Slide 4

Slide 4 text

Where is my money going?

Slide 5

Slide 5 text

How much do I owe others?

Slide 6

Slide 6 text

Started questioning things earlier this year.

Slide 7

Slide 7 text

Spend less Track more

Slide 8

Slide 8 text

Number of solutions = O(∞) Mint.com YNAB Outbank GNUCash ...

Slide 9

Slide 9 text

Proprietary ... mayyyyybe

Slide 10

Slide 10 text

-based ... sorry, that's not happening

Slide 11

Slide 11 text

Requirements Simple No cloud Ideally free Open source Hopefully Python

Slide 12

Slide 12 text

#plaintextaccounting

Slide 13

Slide 13 text

Double Entry Bookkeeping

Slide 14

Slide 14 text

Beancount $ pip install beancount

Slide 15

Slide 15 text

Big Fat Disclaimers ™ I'm not a nancial advisor Aim is to show you the tip of the iceberg Next slide may or may not contain some maths

Slide 16

Slide 16 text

∑(postings) = 0

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

; Date format - YYYY-MM-DD option "title" "Mustermann" option "operating_currency" "EUR" 2018-10-01 open Assets:DKB 2018-10-01 open Income:BigCorp 2018-10-01 open Expenses:Food 2018-10-01 open Expenses:Rent ; ... ; ... ; ... 2018-10-25 "*" "Überweisung BigCorp" Assets:DKB 3000.00 EUR Income:BigCorp -3000.00 EUR 2018-11-01 "*" "Miete" Assets:DKB -1500.00 EUR Expenses:Rent 1500.00 EUR 2018-11-02 "*" "Essen" Assets:DKB -50.00 EUR Expenses:Food 50.00 EUR 2018-10-26 balance Assets:DKB 3000.00 EUR 2018-11-03 balance Expenses:Food 50.00 EUR

Slide 20

Slide 20 text

How to get started?

Slide 21

Slide 21 text

Work ow     

Slide 22

Slide 22 text

Beancount does not understand your CSV les? Write an importer.

Slide 23

Slide 23 text

Sample Importer from beancount.core.amount import Amount from beancount.core.number import Number from beancount.ingest.importer import ImporterProtocol class SampleImporter(ImporterProtocol): # ... def identify(self, file_): """Check if file_ is from the bank we're supposed to work with """ # ... def extract(self, file_): """Read file_, and emit a list of beancount data structures """

Slide 24

Slide 24 text

Fava: web UI for Beancount $ pip install fava

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Bean SQL SELECT month, SUM(position) FROM year = 2017 WHERE account ~ 'Expenses:Supermarket' GROUP BY month

Slide 28

Slide 28 text

What's next? Envelope Budgeting Automating Downloads

Slide 29

Slide 29 text

Resources https://plaintextaccounting.org https://www.reddit.com/r/plaintextaccounting https://aumayr.github.io/beancount-docs-static/ https://beancount.github.io/fava/ Slides https://bit.ly/sg-pymunich-2018

Slide 30

Slide 30 text

Thank you for your time!  bit.ly/sg-pymunich-2018  /  @siddhantgoel  sgoel.org