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.
Checkout the official documentation of this library here: postgres-helper.readthedocs.io/
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 here: https://postgres-helper.readthedocs.io/.
#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.4.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file postgres-helper-0.0.4.tar.gz
.
File metadata
- Download URL: postgres-helper-0.0.4.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5daba066f3ab6fc593457fa470559e75f04111d73e2cb2bb7e61b8ca777baab8 |
|
MD5 | 03cee0b9a82c12770b71d06b31d21f9d |
|
BLAKE2b-256 | 62041ec17baa70a351c5505a08037128f0b46a7065b2d088c1b96a69b3cebe2f |
File details
Details for the file postgres_helper-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: postgres_helper-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc9d1dda665cfabe294f90a287a8e01511df8d104c921563563b6a820a22f967 |
|
MD5 | 3312d180d74fbebdc18679bd8313c93e |
|
BLAKE2b-256 | 902257694d1d8f0f7d79717eb609f89071cec1ebe3f6882686ab974755544ba8 |