TinyExpenses is a minimal, personal finance tracker built with Flask. It supports multi-user setups, tracks expenses and income by category, and exposes a simple API for automation.
- Install Dependencies (inside root dir)
pip install -r .- Set Up Your App
Create a Python file
wsgi.pywith the following content (or modify according to your needs):
from tinyexpenses import create_app
app = create_app("tinyexpenses.config.ProductionHTTPSConfig")Use Waitress and nginx for real production environment.
- Set Environment Variables Before running the app, set the required variables:
export SECRET_KEY="your-very-secret-key"You can generate secret key with:
python -c 'import secrets; print(secrets.token_hex())'Changing the secret key invalidates all user API tokens.
- Run directly (local-only)
flask runTinyExpenses stores user configurations inside a folder (default: accounts/). Create it manually or point to a custom path using ACCOUNTS_DB_DIRECTORY_PATH envariomental path.
mkdir accountsTinyExpenses comes with a built-in CLI to manage users.
python -m tinyexpenses.cli init-user accountsYou will be prompted to enter:
- Username
- Full name
- Password (with confirmation)
Example output:
✅ User 'alice' initialized at accounts/alice/config.tomlReset a User’s Password
python -m tinyexpenses.cli reset-password accounts alicePrompts for a new password with confirmation.
Each user has a separate folder under accounts/, storing their config and data.
Yearly balances are updated automatically based on categories (Income or Expense).
You can add compensation/adjustments using negative amounts (e.g., -50.0).
You can automate expense tracking by sending JSON requests with your user’s API token.
PUT /api/v1/<username>/expenses/append
X-API-Key: your-api-key
Content-type: application/json
{
"amount": 14.99,
"title": "Dinner",
"category": "Food",
"date": "2025-08-02"
}GET /api/v1/{{ username }}/expenses/view/balance HTTP/1.1
X-API-Key: (Here put your X-API key)