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-1.0.1.tar.gz
(14.1 kB
view hashes)
Built Distribution
pgdumplib-1.0.1-py3-none-any.whl
(14.8 kB
view hashes)
Close
Hashes for pgdumplib-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab45c58e0138a8d1765b8564275a9bb38146c879c3831fed6933d66866fd5f73 |
|
MD5 | 6209e356f460034aef698db1ede7c28c |
|
BLAKE2b-256 | 514ac058d467c1352453ef236a4d0dbfa00dcdc6eef3ca3f0f5a239d0896e8c0 |