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
Close
Hashes for pgdumplib-1.0.0.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e54340316dce62b72efbab35aa301254ee6914b6b98dfddeb6844a6c4eba9086 |
|
MD5 | e87d3155492254875d354ab34fe4ed72 |
|
BLAKE2b-256 | 42a64da7fdd9c673e1dd72842d213d5543f0d0f7047bde51b64df36fb5a40291 |