Skip to main content

Production-grade backup engine for files and databases with a web UI

Project description

PyBackup Engine

Production-grade backup engine for files and databases — with a built-in web dashboard.

PyPI version Python 3.10+ License: MIT


Features

Feature Detail
Engines Files, MongoDB, PostgreSQL, MySQL, MS SQL Server
Web Dashboard Pure Python stdlib — no Flask/FastAPI/Django
Database SQLite by default (WAL mode, zero config)
CLI run, verify, checksum, config-check, serve
Security Secrets resolved from env vars, never hard-coded
Fonts Space Grotesk headings · Inter body
Theme Dark / Light toggle

Install

pip install pybackup

Quick Start

1. Write a config

# pybackup.yaml
version: 1

global:
  backup_root: /backups
  retention_days: 7
  compress: true
  log_level: INFO

postgresql:
  enabled: true
  name: prod-db
  host: localhost
  port: 5432
  database: myapp
  username: backup_user
  password: ${PGPASSWORD}    # resolved from env

files:
  enabled: true
  name: app-configs
  source: /etc/myapp
  exclude: ["*.log", "*.tmp"]

2. Run backups

pybackup run --config pybackup.yaml

3. Start the dashboard

pybackup serve --port 8741
# → http://localhost:8741

CLI Reference

pybackup run           -c config.yaml [--dry-run]
pybackup verify        FILE -s CHECKSUM [-a sha256]
pybackup checksum      FILE [-a sha256]
pybackup config-check  -c config.yaml
pybackup serve         [--host 0.0.0.0] [--port 8741] [--db /path/to.db]

Dashboard

The built-in web server serves a single-page dashboard with:

  • Stats cards — total runs, success, failed, success rate
  • Activity chart — 30-day bar chart (Chart.js)
  • Engine doughnut — breakdown by engine
  • Run history — filterable, paginated table with delete support
  • Run detail modal — full metadata including error messages
  • Settings — theme, retention, log level persisted to SQLite
  • Dark / Light theme toggle (Space Grotesk + Inter fonts)

REST API

All served under /api/:

Method Path Description
GET /api/stats Dashboard statistics
GET /api/runs Paginated run list (?limit=&offset=&job=&status=)
POST /api/runs Create a run entry
GET /api/runs/:id Single run detail + files
DELETE /api/runs/:id Delete a run
GET /api/settings All settings
POST /api/settings Update settings

Project Structure

pybackup/
├── cli.py              # Click CLI entry point
├── constants.py        # Global defaults
├── config/
│   └── loader.py       # YAML loader + validation
├── engine/
│   ├── base.py         # Abstract BaseBackupEngine
│   ├── files.py        # File/dir backup
│   ├── mongo.py        # MongoDB (mongodump)
│   ├── postgres.py     # PostgreSQL (pg_dump)
│   ├── mysql.py        # MySQL (mysqldump)
│   ├── mssql.py        # MSSQL (sqlcmd)
│   ├── verify.py       # Checksum verification
│   └── manifest.py     # JSON manifests
├── db/
│   └── database.py     # SQLite persistence layer
├── server/
│   ├── httpserver.py   # Pure stdlib HTTP server + Router
│   └── handlers.py     # REST API handlers
├── static/
│   ├── index.html      # SPA dashboard
│   ├── css/app.css     # Styles (Space Grotesk + Inter)
│   └── js/app.js       # Vanilla JS SPA
└── utils/
    ├── exceptions.py   # Exception hierarchy
    ├── logger.py       # Logging setup
    └── security.py     # Secret resolution + masking

License

MIT

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

pybackup_engine-0.1.1.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

pybackup_engine-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file pybackup_engine-0.1.1.tar.gz.

File metadata

  • Download URL: pybackup_engine-0.1.1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybackup_engine-0.1.1.tar.gz
Algorithm Hash digest
SHA256 36d318a8d43c0882b9e35521cc24d9082fd526e0bb46068a3817dd9a802c2a57
MD5 8930d0cc2cc9ab61b7a6ae7eb599b3cb
BLAKE2b-256 cfbef8f2ca99ebdea7e1442b085a63d11a75709d01ff2e0b35f7e7e72fb0e7dd

See more details on using hashes here.

File details

Details for the file pybackup_engine-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pybackup_engine-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67f5204d7056140a22ccc794a05f51dab3b0743d9dcab572da069221626ad2b7
MD5 9cc2c83b21f4d6085f9dc5989c6acd6f
BLAKE2b-256 2ce62498485022f631bc2c5d65602eb3e661520027e41c4e4e41b5689ea0daf6

See more details on using hashes here.

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