Skip to main content

Create a summary of unique values for each column in a Postgres table or view and summarize results in an Excel workbook.

Project description

pg_summary

ci/cd Documentation Status PyPI Latest Release PyPI Downloads Python Version Support

Create a summary of unique values for each column in a Postgres table or view and summarize results in an Excel workbook.

Output

Installation

You can install pg_summary via pip from PyPI:

pip install pg-summary

There is also a Docker image available on the GitHub Container Registry:

docker pull ghcr.io/geocoug/pg-summary:latest

Usage

The following example demonstrates how to use pg_summary to summarize a Postgres table. By default, the output is an Excel file with one sheet. Each column in the sheet will summarize a column in the Postgres table with the unique values, number of unique values, number of null values, data type, and the column name.

Each of the examples below will produce the exact same output.

Python

from pg_summary import PgSummary

PgSummary(
    host="localhost",
    port=5432,
    database="mydb",
    user="myuser",
    table_or_view="mytable",
    schema="staging",
).summarize()

Command Line

 pg_summary -v localhost -u myuser -d mydb -t mytable -s staging

Docker

docker run --rm -v $(pwd):/data ghcr.io/geocoug/pg-summary:latest -v localhost -u myuser -d mydb -t mytable -s staging

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pg_summary-0.0.3.tar.gz (47.4 kB view details)

Uploaded Source

Built Distribution

pg_summary-0.0.3-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file pg_summary-0.0.3.tar.gz.

File metadata

  • Download URL: pg_summary-0.0.3.tar.gz
  • Upload date:
  • Size: 47.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pg_summary-0.0.3.tar.gz
Algorithm Hash digest
SHA256 64f9890e97c926f7e8a00bb7acc9ab5bc4fbf1eb84c6bb88934948b45567f251
MD5 f2612da34865c4bf1f3bf4a4f1d341c4
BLAKE2b-256 daddc402f6d88e7e4d361ddb80697d72a1adaf92cc19592a77ab417a0524976f

See more details on using hashes here.

File details

Details for the file pg_summary-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pg_summary-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 32.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pg_summary-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f80b26c89f0d543add8e58f6d6da29eebb0cf58a2376698d7c29bbacd04a15d6
MD5 f9e680ed2923cc1efa0c9fb176a8d086
BLAKE2b-256 903a22d23f9febe5d48e11f83b21bc515e3ad8f6a516208ba2332cf73170c8c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page