Worek - A Database Backup Tool
Worek is a database backup tool.
- Create full binary backups of a PostgreSQL database
- Restore a text or binary backup of a PostgreSQL database
- Can restore a database over the top of an existing database (clears all data first) meaning you don't need a super user to restore a database.
Usage
Create a backup with the contents going to a file:
$ worek backup -d database_name -f ./backup.bin
Create a backup with the contents going to STDOUT
$ worek backup -d database_name \
| openssl enc -aes-256-cbc -pass file:password.txt -md sha256 -d -out backup.bak.enc
Restore a backup from STDIN. Note you have to use the -F property to specify
the type of backup you are handing. This is not required when using -f and
specifying the file path.
$ openssl enc -aes-256-cbc -pass file:password.txt -md sha256 -d -in backup.bak.enc \
| worek restore -h localhost -d database_name -F c
Supports standard PG environment variables
$ PGPORT=5432 worek backup -d database_name -f ./backup.bin
Postgres Client Version
Worek makes use of Postgres client utilities internally to create/restore backups. If multiple versions of the utilities are present, by default Worek will attempt to match the version of the utilities to the database server version.
You may also specify a particular version of the client utilities to use via the
--version or -v option. This feature requires pg_wrapper to be installed on the
system.
$ worek backup -d database_name -f ./backup.bin -v 11
Dev
Copier Template
Project structure and tooling mostly derives from Coppy. See its documentation for context and additional instructions.
This project can be updated from the upstream repo, see Updating a Project.
Project Setup
From zero to hero (passing tests that is):
-
Ensure host dependencies are installed
-
Start docker service dependencies (if applicable):
docker compose up -d -
Sync project virtualenv w/ lock file:
uv sync -
Configure prek:
prek install -
Run tests:
nox
Versions
Versions are date based. A version task shows and bumps versions:
# Show current version
mise version show
# Bump version based on date, tag, and push:
mise version bump
# See other options
mise version -- --help
Metadata
Release files for worek 0.20260912.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| worek-0.20260912.1.tar.gz | 92.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| worek-0.20260912.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 103.6 kB
Release files / worek-0.20260912.1.tar.gz
| Download URL | worek-0.20260912.1.tar.gz |
|---|---|
| Size | 92.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c5c481dfc13a1059cafcf46c550616fac4bba2ae2e6a8b61313c36ab73b28e3
|
|
BLAKE2b-256 checksum How to use checksums |
2893936acd945646af6be913dc53b085d0c6b0e0e85aef3c0b6f614321088efb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency logRelease files / worek-0.20260912.1-py3-none-any.whl
| Download URL | worek-0.20260912.1-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7797b8c23ddb8aa58b22e3fe30aa5b7503f3a5e820c833c04559964ecac2f831
|
|
BLAKE2b-256 checksum How to use checksums |
95996dabdeec4ce354d370475d516455bdcd1d8a4223e8b6c8e03313bb11c5b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.
Transparency log