Skip to main content

Smart ledger that takes care of your expenses

Project description

QuickLedger

QuickLedger is a fast, intuitive, CLI-first expense tracker built with Python and Typer. Track your daily spending using natural language, export summaries, and optionally extend via a lightweight FastAPI backend.


Features

  • Add expenses via command line (ledger add)
  • View by day, week, or custom date range
  • Natural language support (e.g. Bought food for 2000)
  • Summary and basic analytics
  • Edit and delete entries
  • Export to CSV
  • Simple REST API (no auth yet)
  • JSON-based storage (easy to inspect and backup)
  • Pythonic, Typer-powered CLI with FastAPI backend

Installation

You can use either pip (recommended for end users) or poetry (recommended for contributors or development setup).

โœ… Option 1: Using pip (PyPI)

pip install quickledger

Then you can use it directly via:

ledger

๐Ÿ› ๏ธ Option 2: Using Poetry (Development)

  1. Clone the repo:
git clone https://github.com/chinyereunamba/ledger.git
cd ledger
  1. Install dependencies:
poetry install
  1. Run the CLI:
poetry run ledger

CLI Commands

โž• Add Expense

ledger add

Supports natural language:

ledger say "Bought food for 1500"

๐Ÿ“… View Expenses

ledger view --date 2025-07-25
ledger view --week
ledger view --range 2025-07-01 2025-07-25

โœ๏ธ Edit or Delete

ledger edit --date 2025-07-24 --index 1
ledger delete --date 2025-07-24 --index 1

๐Ÿ“ค Export

ledger export --path my_expenses.csv

๐ŸŒ API

Start the FastAPI server from the api/ folder:

uvicorn main:app --reload

Endpoints

Method Endpoint Description
GET /expenses/ Get all expenses
POST /expenses/ Add a new expense
GET /expenses/{date} Get expenses for a date
DELETE /expenses/{date} Delete all expenses for a date
GET /summary/ Get total summary
GET /summary/{date} Summary for a specific date
GET /summary/week Past 7 days summary
GET /summary/range Summary for a date range

โš ๏ธ No authentication yet โ€” intended for local/private use.


๐Ÿง  NLP Support

You can input expenses like:

ledger say "Paid for transport 700"

This is automatically parsed as:

  • Expense: transport
  • Amount: 700
  • Date: today (default)

๐Ÿ“‚ Project Structure

ledger/
โ”œโ”€โ”€ ledger/               # CLI logic & utilities
โ”‚   โ”œโ”€โ”€ ledger.py
โ”‚   โ”œโ”€โ”€ utils.py
โ”‚   โ””โ”€โ”€ constants.py
โ”œโ”€โ”€ api/                  # FastAPI backend
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ””โ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ models.py
โ”œโ”€โ”€ ledger.json           # Local JSON storage
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ pyproject.toml        # Poetry config
โ”œโ”€โ”€ README.md             # โ† You're here
โ””โ”€โ”€ LICENSE

๐Ÿ“ฆ PyPI

Coming soon to PyPI for easier installation via pip.


๐Ÿ“ƒ License

MIT ยฉ 2025 Chinyere Unamba

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quickledger-0.1.4.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quickledger-0.1.4-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file quickledger-0.1.4.tar.gz.

File metadata

  • Download URL: quickledger-0.1.4.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.12 Linux/6.8.0-60-generic

File hashes

Hashes for quickledger-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7f0d02874c3fff2a05bc98ddd474e2f5157304313eb05e832c7d378c3e13b530
MD5 46a71afd9f80c37a581f21832e16c3e4
BLAKE2b-256 a02f27aace40580885ddc8c15cdf2aa9343f4b196262e5cf4d8fa7c51fef902c

See more details on using hashes here.

File details

Details for the file quickledger-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: quickledger-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.12 Linux/6.8.0-60-generic

File hashes

Hashes for quickledger-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3f9fb8a87e37a040272bca95aef482a0f2c9d88230ecc74a7fac3caf8c445295
MD5 24c59336b8cf4a90460e225e3f400608
BLAKE2b-256 87ce23f6134c3f79b32f26ed7549c229684c341775eecf28abfd84afee7fac21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page