A backup handler
pip install pydbbackups
dbbackups dump \
--name backup-example \
--database-type postgres \
--host localhost \
--database test \
--username postgres \
--port 5432
# 0__backup-example.sql Created !
from pydbbackups import Postgres
cls = Postgres(
database="test",
host="localhost",
port=5432,
username="postgres",
password="postgres"
)
# In some cases dump method, return None
output = cls.dump() # Return BytesIO
print(output.read().decode('utf-8'))
@jbuendia1y <jbuendia1y@gmail.com>