Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Managing Personal Finances using Python

Managing Personal Finances using Python

Siddhant Goel

October 24, 2018
Tweet

More Decks by Siddhant Goel

Other Decks in Programming

Transcript

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

    View Slide

  2. Let's talk about money.

    View Slide

  3. What is my net worth?

    View Slide

  4. Where is my money going?

    View Slide

  5. How much do I owe others?

    View Slide

  6. Started questioning things earlier this year.

    View Slide

  7. Spend less
    Track more

    View Slide

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

    View Slide

  9. Proprietary
    ... mayyyyybe

    View Slide

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

    View Slide

  11. Requirements
    Simple
    No cloud
    Ideally free
    Open source
    Hopefully Python

    View Slide

  12. #plaintextaccounting

    View Slide

  13. Double Entry Bookkeeping

    View Slide

  14. Beancount
    $ pip install beancount

    View Slide

  15. 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

    View Slide

  16. ∑(postings) = 0

    View Slide

  17. View Slide

  18. View Slide

  19. ; 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

    View Slide

  20. How to get started?

    View Slide

  21. Work ow
        

    View Slide

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

    View Slide

  23. 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
    """

    View Slide

  24. Fava: web UI for Beancount
    $ pip install fava

    View Slide

  25. View Slide

  26. View Slide

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

    View Slide

  28. What's next?
    Envelope Budgeting
    Automating Downloads

    View Slide

  29. 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

    View Slide

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

    View Slide