Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Python tools for DBAs with deadlines!

Project description

A handy Python library for common database admin operations.

https://img.shields.io/pypi/v/pydba.svg

Requirements

https://img.shields.io/pypi/pyversions/pydba.svg

Features

Basic imports and class constructor usage.

>>> from pydba import PostgresDB
>>> db = PostgresDB()
>>> db.available()
True
>>> db.names()
['postgres']

Database creation and deletion.

>>> db.create('foo')
>>> db.names()
['postgres', 'foo']
>>> db.rename('foo', 'bar')
>>> db.names()
['postgres', 'bar']

Database backup and restore.

>>> db.dump('bar', 'bar.backup')
>>> db.drop('bar')
>>> db.names()
['postgres']
>>> db.restore('bar', 'bar.backup')
>>> db.names()
['postgres', 'bar']

Querying and shutting down database connections.

>>> db.connections('postgres')
[Connection(datname='postgres', pid=13832, state='idle', query='', usename='drkjam', ...)]
>>> db.kill_connections('postgres')
>>> db.connections('postgres')
[]

Download files

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

Files for pydba, version 1.2.1
Filename, size File type Python version Upload date Hashes
Filename, size pydba-1.2.1-py2.py3-none-any.whl (9.6 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size pydba-1.2.1.tar.gz (6.8 kB) File type Source Python version None Upload date Hashes View
Filename, size pydba-1.2.1.zip (10.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page