Skip to main content

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.

Source Distributions

pydba-1.2.1.zip (10.4 kB view hashes)

Uploaded source

pydba-1.2.1.tar.gz (6.8 kB view hashes)

Uploaded source

Built Distribution

pydba-1.2.1-py2.py3-none-any.whl (9.6 kB view hashes)

Uploaded 2 7

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page