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.1.0.tar.gz (11.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.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: patronx-1.1.0.tar.gz
  • Upload date:
  • Size: 11.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.1.0.tar.gz
Algorithm Hash digest
SHA256 ffdde7b4a640567a0fb52ec9a2cc11cd0fb321fba01dfa5a66bf72163b719dae
MD5 1cbac35bba6ec873a5cd0411ef0afa0e
BLAKE2b-256 9f7ab94f6850d95b25967da40308ac4678df84020fe9e95e0de69b600e8fabca

See more details on using hashes here.

Provenance

The following attestation bundles were made for patronx-1.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: patronx-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51c65726289c78c72213601632ce88575f0ba5745144f02f46dfeb0ef624a4fd
MD5 7ab7e8668f469e40adef33353955b014
BLAKE2b-256 5f1780b2fc1f12f44121efee6a1964348871d959f55ce66a0555cec739558bd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for patronx-1.1.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