Skip to content

chrishas35/simplefin-python

Folders and files

NameName
Last commit message
Last commit date
Feb 21, 2025
Jan 11, 2025
Jan 31, 2025
Jan 31, 2025
Jan 12, 2025
Jan 12, 2025
Jan 12, 2025
Jan 11, 2025
Jan 13, 2025
Jan 31, 2025
Jan 31, 2025
Jan 31, 2025
Jan 31, 2025

Repository files navigation

SimpleFIN Python Library

Installation

pip install simplefin

Command line interface

Setup

You will first need to get a setup token and convert it to an access URL.

  1. Create a new application connection in you SimpleFIN Bridge account.
  2. Copy the provided setup key to your clipboard.
  3. Run simplefin setup and paste the setup key from above.
  4. Securely store the provided Access URL as it is required for future calls.

See #1 for discussion on securely storing this in future releases.

Usage

Your Access URL will need to be stored in an environment variable called SIMPLEFIN_ACCESS_URL for future CLI calls.

Examples below leverage the SimpleFIN Bridge Demo Access URL of https://demo:demo@beta-bridge.simplefin.org/simplefin. Real world Account IDs will be in the format of ACT-[guid].

Get accounts

simplefin accounts [--format FORMAT]

❯ simplefin accounts
                        SimpleFIN Accounts                         
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Institution    ┃ Account            ┃ Balance   ┃ Account ID    ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ SimpleFIN Demo │ SimpleFIN Savings  │ 115525.50 │ Demo Savings  │
│ SimpleFIN Demo │ SimpleFIN Checking │ 26134.42  │ Demo Checking │
└────────────────┴────────────────────┴───────────┴───────────────┘
JSON output
❯ simplefin accounts --format json
[
    {
        "org": {
            "domain": "beta-bridge.simplefin.org",
            "sfin-url": "https://beta-bridge.simplefin.org/simplefin",
            "name": "SimpleFIN Demo",
            "url": "https://beta-bridge.simplefin.org",
            "id": "simplefin.demoorg"
        },
        "id": "Demo Savings",
        "name": "SimpleFIN Savings",
        "currency": "USD",
        "balance": "115525.50",
        "available-balance": "115525.50",
        "balance-date": 1738368000,
        "transactions": [],
        "holdings": []
    },
    {
        "org": {
            "domain": "beta-bridge.simplefin.org",
            "sfin-url": "https://beta-bridge.simplefin.org/simplefin",
            "name": "SimpleFIN Demo",
            "url": "https://beta-bridge.simplefin.org",
            "id": "simplefin.demoorg"
        },
        "id": "Demo Checking",
        "name": "SimpleFIN Checking",
        "currency": "USD",
        "balance": "26134.42",
        "available-balance": "26134.42",
        "balance-date": 1738368000,
        "transactions": [],
        "holdings": []
    }
]

Get transactions for an account

simplefin transactions ACCOUNT_ID [--format FORMAT] [--lookback-days INTEGER]

❯ simplefin transactions "Demo Savings"
         Transactions for Demo Savings         
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ Date        ┃ Payee               ┃ Amount  ┃
┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
│ 01 Feb 2025 │ You                 │ 1960.00 │
│ 01 Feb 2025 │ John's Fishin Shack │ -05.50  │
│ 01 Feb 2025 │ Grocery store       │ -135.50 │
└─────────────┴─────────────────────┴─────────┘
JSON output
❯ simplefin transactions "Demo Savings" --format json
{
    "errors": [],
    "accounts": [
        {
            "org": {
                "domain": "beta-bridge.simplefin.org",
                "sfin-url": "https://beta-bridge.simplefin.org/simplefin",
                "name": "SimpleFIN Demo",
                "url": "https://beta-bridge.simplefin.org",
                "id": "simplefin.demoorg"
            },
            "id": "Demo Savings",
            "name": "SimpleFIN Savings",
            "currency": "USD",
            "balance": "115525.50",
            "available-balance": "115525.50",
            "balance-date": 1738368000,
            "transactions": [
                {
                    "id": "1738382400",
                    "posted": 1738382400,
                    "amount": "1960.00",
                    "description": "Pay day!",
                    "payee": "You",
                    "memo": "PAY DAY - FROM YER JOB"
                },
                {
                    "id": "1738396800",
                    "posted": 1738396800,
                    "amount": "-05.50",
                    "description": "Fishing bait",
                    "payee": "John's Fishin Shack",
                    "memo": "JOHNS FISHIN SHACK BAIT"
                },
                {
                    "id": "1738425600",
                    "posted": 1738425600,
                    "amount": "-135.50",
                    "description": "Grocery store",
                    "payee": "Grocery store",
                    "memo": "LOCAL GROCER STORE #1133"
                }
            ],
            "holdings": [
                {
                    "id": "25bc4910-4cb4-437b-9924-ee98003651c5",
                    "created": 345427200,
                    "cost_basis": "55.00",
                    "currency": "USD",
                    "description": "Shares of Apple",
                    "market_value": "105884.8",
                    "purchase_price": "0.10",
                    "shares": "550.0",
                    "symbol": "AAPL"
                }
            ]
        }
    ]
}