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.
- 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
You can use either pip (recommended for end users) or poetry (recommended for contributors or development setup).
pip install quickledgerThen you can use it directly via:
ledger- Clone the repo:
git clone https://github.com/chinyereunamba/ledger.git
cd ledger- Install dependencies:
poetry install- Run the CLI:
poetry run ledgerledger/
├── src/ # Source code
│ ├── ledger/ # Core business logic
│ ├── api/ # FastAPI application
│ └── cli/ # CLI interface
├── tests/ # Test suite
├── frontend/ # Frontend application
├── scripts/ # Development scripts
├── docker/ # Docker configuration
└── config/ # Configuration files
See PROJECT_STRUCTURE.md for detailed structure documentation.
ledger addSupports natural language:
ledger say "Bought food for 1500"ledger view --date 2025-07-25
ledger view --week
ledger view --start 2025-07-01 --end 2025-07-25ledger edit --date 2025-07-24 --index 1
ledger delete --date 2025-07-24 --index 1ledger export --path my_expenses.csvStart the FastAPI server:
# Using Makefile
make api
# Or directly
cd src/api && uvicorn main:app --reload| 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 |
You can input expenses like:
ledger say "Paid for transport 700"This is automatically parsed as:
- Expense: transport
- Amount: 700
- Date: today (default)
# Install dependencies
poetry install
# Or with pip
pip install -r requirements.txt# Run all tests
make test
# With coverage
make test-cov
# Or directly
pytest tests/ -v# Format code
make format
# Lint code
make lint
# Clean cache files
make clean# Start both API and frontend
make dev
# Or individually
make api # API server on :8000
make frontend # Frontend server on :3000# Build images
make docker-build
# Start containers
make docker-up
# View logs
make docker-logs
# Stop containers
make docker-downThe codebase follows clean architecture principles with clear separation of concerns:
- Domain Layer: Pure Python data models
- Service Layer: Business logic
- Repository Layer: Data access abstraction
- API Layer: HTTP request/response handling
- CLI Layer: Command-line interface
See ARCHITECTURE.md for detailed architecture documentation.
Coming soon to PyPI for easier installation via pip.
MIT © 2025 Chinyere Unamba