Skip to main content

Simple package for backups and recovery

Project description

PatronX

PatronX is a lightweight toolkit for PostgreSQL backups, point‑in‑time recovery and object‑storage offloading. The project is written in modern typed Python and ships with a clean command‑line interface.

codecov Test Docker publish PyPI publish PyPI

Features

  • Simple CLI for backup, restore and listing available dumps
  • Scheduled backups via cron expressions
  • Optional upload to S3 for off‑site storage
  • Typed Python code with unit tests

DB

  • postgres >= 16
pip install -e . # to install in editable mode
patronx --version
patronx list
patronx check-db
patronx backup [--plain] [--no-progress]
patronx restore --inp /path/to/backup.dump [--plain] [--no-progress]
patronx server

patronx enqueue-backup # with remoulade and rabbitmq

The server command starts schedulers that enqueue backup and cleanup jobs periodically. The backup schedule is controlled via the BACKUP_CRON environment variable while cleanup uses CLEANUP_CRON. Both take standard cron expressions. When unset they default to running once per day for backups and at 1AM for cleanup. Old backups are removed according to the number of days specified in RETENTION_DAYS (defaults to 30).

Test

pytest

Linting and Formatting

ruff check . --fix
isort .

Generate requirements

pip install pip-tools
pip-compile --output-file=requirements.txt pyproject.toml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

patronx-1.2.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

patronx-1.2.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file patronx-1.2.0.tar.gz.

File metadata

  • Download URL: patronx-1.2.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for patronx-1.2.0.tar.gz
Algorithm Hash digest
SHA256 11789ccb48a50adb80cd772ae33c3bee2304c4c0829efbe91b03018acaa5d199
MD5 44ea6bca61749d210bddf1087465b647
BLAKE2b-256 c9356b743557137bf24bd0913e7ad0122ce7325a304cb7eb7d8df3e816385888

See more details on using hashes here.

Provenance

The following attestation bundles were made for patronx-1.2.0.tar.gz:

Publisher: cd-publish-to-pypi.yml on xdanielsb/patronx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file patronx-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: patronx-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for patronx-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc67d833d6a77eafccb370aa486213b44cdd22120a00f9c8ccc9abb437bafbac
MD5 62d2a5ca32ba0c25c89e50fd91167f73
BLAKE2b-256 901255daadb7a4bec9db771793880f441d22ba5393cb2df67790b3ad11eb0d4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for patronx-1.2.0-py3-none-any.whl:

Publisher: cd-publish-to-pypi.yml on xdanielsb/patronx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page