nemirlev/zenexport
ZenMoney Export is a tool designed to export and sync data from ZenMoney to your own database.
286
ZenMoney Export is a tool designed to export and sync data from the personal finance management service ZenMoney to your own database.
Obtain an API token from ZenMoney by visiting Zerro.app and following the instructions to generate your token.
./docker
directory.docker compose -f ./docker/docker-compose.postgres.yml up -d
Global 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:
go run main.go --help
Default 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-token
Parameters 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/dbname
Now 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 --force
Example for incremental sync with a 5-minute interval:
go run main.go sync --interval 5 --daemon
Example for running full sync with a dry run:
go run main.go sync --dry-run
We welcome contributions! Please follow these steps:
To ensure the project remains robust, run tests using:
go test ./...
This 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.
docker pull nemirlev/zenexport