Package for Postgres query on python
Project description
Postgres Helper
The postgres-helper
library is build on top of psycopg2
. It will be really helpful for running the basic postgresql query in python.
Installation
For installation of postgres-helper
, you need to run following command
pip install postgres-helper
Examples using this library
Please check the official documentation for full documentation.
#Library import
from pg.pg import Pg
# Initialization of library
pg = Db(dbname='postgres', user='postgres', password='admin', host='localhost', port='5432')
# Get the column names of the specific table
pg.get_columns_name(table='pg_table')
# Get values from specific column of table
pg.get_values_from_column(column='pg_table_col', table='pg_table', schema='public')
# Create schema
pg.create_schema(name='schema_name')
# Create column
pg.create_column(column='col_name', table='pg_table', col_datatype='varchar', schema='public')
# Update column
pg.update_column(column='col_name', value='updated_value', table='pg_table', where_column='where_col', where_value="where_val", schema='public')
# Delete table
pg.delete_table(name='pg_table', schema='public')
# Delete values
pg.delete_values(table_name='pg_table', condition='name=value', schema='public')
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
postgres-helper-0.0.1.tar.gz
(3.1 kB
view details)
File details
Details for the file postgres-helper-0.0.1.tar.gz
.
File metadata
- Download URL: postgres-helper-0.0.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b649a482564c263f2bb9bce7ba03691a778a42a886b2754f5adb7f700050950 |
|
MD5 | f920dffed2f952eb0ff52757bcd8c767 |
|
BLAKE2b-256 | 5f227dcb10b801aa0624b4b285078c6c0a85736bad102f6b3b07d33e56c87e92 |