zenmoney-rs
Rust client library for the ZenMoney personal finance API.
Features
- Async and blocking HTTP clients (feature-gated)
- Incremental and full sync via the diff endpoint
- CRUD operations: push (create/update) and delete for all entity types
- Composable
TransactionFilterwith builder pattern (date range, account, tag, payee, merchant, amount) - Category suggestion endpoint
- Pluggable storage backends (
FileStorageincluded,InMemoryStoragefor testing, custom backends viaStorage/BlockingStoragetraits) - Strongly-typed models with newtype IDs (
AccountId,TagId,TransactionId, etc.) - Optional CLI binary for browsing synced data
Installation
Add to your Cargo.toml:
[]
= "0.3"
Feature flags
| Flag | Default | Description |
|---|---|---|
async |
Yes | Async HTTP client (requires tokio runtime) |
blocking |
No | Blocking HTTP client |
storage-file |
Yes | JSON file-based storage backend |
oauth |
No | OAuth authorization URL builder |
cli |
Yes | CLI binary (zenmoney) |
full |
No | Enables all features |
To use only the blocking client without the CLI:
[]
= { = "0.3", = false, = ["blocking", "storage-file"] }
Usage
Blocking client
use FileStorage;
use ;
Async client
use FileStorage;
use ZenMoney;
async
Testing
Use InMemoryStorage for unit and integration tests — no file I/O needed:
use InMemoryStorage;
use ZenMoneyBlocking;
let storage = new;
let client = builder
.token
.storage
.build
.unwrap;
CLI
The zenmoney binary provides a command-line interface for syncing and browsing data. Set the ZENMONEY_TOKEN environment variable (or use a .env file):
Development
This project uses just as a task runner:
Requirements
- Rust 1.93+ (pinned via
rust-toolchain.toml) - just (task runner)
- cargo-deny (dependency audit)
- cargo-machete (unused dependency detection)
- cargo-llvm-cov (code coverage)
See CONTRIBUTING.md for detailed contribution guidelines.
License
Licensed under either of
at your option.