Python3 library for working with pg_dump files
Project description
Python3 library for reading and writing pg_dump files using the custom format.
Installation
pip install pgdumplib
Example Usage
The following example shows how to create a dump and then read it in, and iterate through the data of one of the tables.
pg_dump -d pgbench -Fc -f pgbench.dump
import pgdumplib
dump = pgdumplib.load('pgbench.dump')
print('Database: {}'.format(dump.toc.dbname))
print('Archive Timestamp: {}'.format(dump.toc.timestamp))
print('Server Version: {}'.format(dump.toc.server_version))
print('Dump Version: {}'.format(dump.toc.dump_version))
for line in dump.table_data('public', 'pgbench_accounts'):
print(line)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pgdumplib-3.0.0.tar.gz
(16.2 kB
view details)
File details
Details for the file pgdumplib-3.0.0.tar.gz.
File metadata
- Download URL: pgdumplib-3.0.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab239c2737b98115157d9a66831b24e51b988e12f98e17af1c7e4a1973abe02e
|
|
| MD5 |
5acab5027f98c51abc504d71802e2d2f
|
|
| BLAKE2b-256 |
1469ec3e3f9bc7ddb26113b8578c1e6ed8cc076d012ce1767246aedeac6f0812
|