Skip to main content
Wrapper Class around Psycopg2 for PostgreSQL

In psycopg2 after connecting to the database, for every read execute statement the data needs to be fetched and for evey write execute statement the data needs to be committed. But this class eliminates these requirements and make it simple to read and write to the database.

Files:

palpg/__init__.py

Installation:

sudo pip3 install palpg

Usage Examples:

import palpg

db = palpg.db(“host=HOST port=PORT dbname=DBNAME user=USER password=PASSWORD”) ##-connect to the database

db.read(“sql statement”) ##-returns the read data from database with flat=True

db.read(“select item from table”, flat=False) ##-returns the raw read data

db.read(“select item from table where item = %s”, (sub1,)) ##-read with string substitution

db.read1(“sql statement”) ##-returns the first read data similar to fetchone

db.write(“sql statement”) ##-writes the data and commits to the database

db.clear() #-to reconnect if any transaction error

For other psycopg connection commands use the connection class

db.conn….

Metadata

Release files for palpg 2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for palpg 2.3
File Size Uploaded
palpg-2.3.tar.gz 1.9 kB Details

Release files / palpg-2.3.tar.gz

Download URL palpg-2.3.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f343c08a1ac0899e3caa2b1919fbbbced54be62e0c534b0aa96bd07a4b1d1e15
BLAKE2b-256 checksum
How to use checksums
136871a675da090dc79ac2d30ef8b97aff075850d5b970ad574ebee43894d4d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release history Release notifications | RSS feed

This release

2.3 This release

1 release file

2.2

1 release file

2.1

1 release file

2.0

1 release file

1.95

1 release file

1.9

1 release file

1.8

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page