Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gmr/pgdumplib
Python3 library for reading and writing pg_dump files using the custom format
https://github.com/gmr/pgdumplib
backup library pg-dump pg-restore postgresql python3
Last synced: 12 days ago
JSON representation
Python3 library for reading and writing pg_dump files using the custom format
- Host: GitHub
- URL: https://github.com/gmr/pgdumplib
- Owner: gmr
- License: bsd-3-clause
- Created: 2018-06-14T15:12:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-22T23:54:12.000Z (over 3 years ago)
- Last Synced: 2024-10-14T17:13:04.405Z (25 days ago)
- Topics: backup, library, pg-dump, pg-restore, postgresql, python3
- Language: Python
- Homepage: https://pgdumplib.readthedocs.io
- Size: 130 KB
- Stars: 31
- Watchers: 3
- Forks: 4
- Open Issues: 8
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
pgdumplib
=========Python3 library for reading and writing pg_dump files using the custom format.
|Version| |Status| |Coverage| |License| |Docs|
Installation
------------.. code-block:: bash
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... code-block:: python
pg_dump -d pgbench -Fc -f pgbench.dump
.. code-block:: python
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).. |Version| image:: https://img.shields.io/pypi/v/pgdumplib.svg
:target: https://pypi.python.org/pypi/pgdumplib
:alt: Package Version.. |Status| image:: https://github.com/gmr/pgdumplib/workflows/Testing/badge.svg
:target: https://github.com/gmr/pgdumplib/actions
:alt: Build Status.. |Coverage| image:: https://codecov.io/gh/gmr/pgdumplib/branch/master/graph/badge.svg
:target: https://codecov.io/github/gmr/pgdumplib?branch=master
:alt: Code Coverage.. |License| image:: https://img.shields.io/pypi/l/pgdumplib.svg
:target: https://github.com/gmr/pgdumplib/blob/master/LICENSE
:alt: BSD.. |Docs| image:: https://img.shields.io/readthedocs/pgdumplib.svg
:target: https://pgdumplib.readthedocs.io/
:alt: Documentation Status