Skip to main content

Worek - A Database Backup Tool

nox Codecov

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):

  1. Ensure host dependencies are installed

  2. Start docker service dependencies (if applicable):

    docker compose up -d

  3. Sync project virtualenv w/ lock file:

    uv sync

  4. Configure prek:

    prek install

  5. 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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for worek 0.20260912.2
File Size Uploaded
worek-0.20260912.2.tar.gz 94.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for worek 0.20260912.2
File Interpreter ABI Platform
worek-0.20260912.2-py3-none-any.whl Python 3 none any Details

Total release size: 105.5 kB

Release files / worek-0.20260912.2.tar.gz

Download URL worek-0.20260912.2.tar.gz
Size 94.5 kB
Tags Source
SHA-256 checksum
How to use checksums
860edbc30d9504ee37d110073a97019adcc3838d2d33274b3411c5fb7ffc44fd
BLAKE2b-256 checksum
How to use checksums
04547f408ee3a8f54b9263a87f49a5e23f10287fd4b564664611faac49de6b59
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

Release files / worek-0.20260912.2-py3-none-any.whl

Download URL worek-0.20260912.2-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ffed414cc5b7aa11829fc4983dda6a34cdc182afe3a6a6c4e16933e53b134e9
BLAKE2b-256 checksum
How to use checksums
6c56e0fa1905d2478d0d1e15bcd0218fb16de30259decf8043e50cc4beb54adc
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

Release history Release notifications | RSS feed

This release

0.20260912.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page