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 full-size slide

  2. Let's talk about money.

    View full-size slide

  3. What is my net worth?

    View full-size slide

  4. Where is my money going?

    View full-size slide

  5. How much do I owe others?

    View full-size slide

  6. Started questioning things earlier this year.

    View full-size slide

  7. Spend less
    Track more

    View full-size slide

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

    View full-size slide

  9. Proprietary
    ... mayyyyybe

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  12. #plaintextaccounting

    View full-size slide

  13. Double Entry Bookkeeping

    View full-size slide

  14. Beancount
    $ pip install beancount

    View full-size 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 full-size slide

  16. ∑(postings) = 0

    View full-size slide

  17. ; 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 full-size slide

  18. How to get started?

    View full-size slide

  19. Work ow
        

    View full-size slide

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

    View full-size slide

  21. 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 full-size slide

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

    View full-size slide

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

    View full-size slide

  24. What's next?
    Envelope Budgeting
    Automating Downloads

    View full-size slide

  25. 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 full-size slide

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

    View full-size slide