ZenMoney Export is a tool designed to export and sync data from the personal finance management service ZenMoney to your own database.
- 🚀 Fast and reliable synchronization. Support Full and Incremental sync modes.
- 📊 Supports PostgreSQL (with plans for other databases).
- 🛠️ Easy-to-configure options for various use cases.
- 🐳 Docker-ready for seamless deployment.
Obtain an API token from ZenMoney by visiting Budgera or Zerro.app and following the instructions to generate your token.
- Choose a supported database type from
./dockerdirectory. - Change environment in the docker compose file.
- Start the database and the exporter. Example for PostgreSQL:
docker compose -f ./docker/docker-compose.postgres.yml up -dGlobal variables:
ZEN_API_TOKEN: Your ZenMoney API token.DB_URL: Connection string for your database. Example:postgres://user:password@localhost:5432/dbname.DB_TYPE: Database type. Default:postgres.LOG_LEVEL: Log level for the exporter. Default:info.FORMAT: Export format. Default:json.
Command-specific variables:
- Refer to the command-specific help by running:
go run main.go --helpDefault configuration file is ~/.zenexport.yaml. You can specify a custom file using the --config flag.
db_type: postgres
db_config: "postgres://postgres:postgres@localhost:5432/postgres"
log_level: debug
format: json
token: not-a-real-tokenParameters can be set using environment variables or directly via command-line arguments.
go run main.go --token=your-token-here --db-url=postgres://user:password@localhost:5432/dbnameNow app supports the following commands:
sync: Synchronize data from ZenMoney to your database.
The sync command is used to synchronize data from ZenMoney to your database. If command run first time, it will
perform a full sync (in demon mode full sync plus incremental sync every interval minutes). Otherwise, it will perform
an incremental sync. Also you can force a full sync using the --force
Flags:
-d,--daemon: Run the sync in daemon mode, continuously syncing at intervals.--dry-run: Perform a trial run with no changes made to the database.--entities string: Specify which entities to sync (default "all").--force: Force a full sync, ignoring any previous sync state.-h,--help: Show help information for the sync command.--interval int: Set the sync interval in minutes (default 30).
Example for full sync entities transactions and accounts plus getting the latest data:
go run main.go sync --entities transactions,accounts --forceExample for incremental sync with a 5-minute interval:
go run main.go sync --interval 5 --daemonExample for running full sync with a dry run:
go run main.go sync --dry-runWe welcome contributions! Please follow these steps:
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Submit a pull request.
To ensure the project remains robust, run tests using:
go test ./...Linting uses golangci-lint v2 with a dedicated module (golangci-lint.mod) so the main go.mod stays clean. Config: .golangci.yml.
make lint # run linter
make lint-fix # run linter with auto-fixThis project is licensed under the MIT License. See the LICENSE file for details.
Thanks to the ZenMoney team for their API and documentation, and to all contributors who help make this tool better.