Wrapper around psycopg3 using easy functions to interact with postgres.
Project description
wrapg
Wrapper around psycopg 3.x meant to make easy use of postgres within scripts using simple functions.
Project is in infancy, work in progress.
Table of Contents
Features
- Simple functions to run postgres sql via python
- Pass various data structutes into sql functions
- supports pandas dataframe out of box
- Auto import default postgres connection parameters via .env
- saves on repeating code to specify connection
- overide default connection parameters with kwargs in each function
- see examples for more details (future)
- Upsert, insert_ignore functions included
- automatically creates index
- option to upsert/insert_ignore without creating index (future)
- Copy functions to follow postgres COPY protocol (today only csv is avail)
Setup
Dependencies:
- python 3.10+
- psycopg[binary]>=3.0.11
- pandas>=1.4.2
Usage
- TODO: add examples later
Todo
- Add delete funtionality
- Handle JSON, ITERATOR?
- Add tests
- Make into package on pypi
- Optimize code after it is all working
Acknowledgements
This project built on great work by psycopg 3 and was inspired by dataset
Contact
Created by jturnercode - hope package is helps.
License
- MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wrapg-0.1.1.tar.gz
(10.4 kB
view hashes)
Built Distribution
wrapg-0.1.1-py3-none-any.whl
(10.0 kB
view hashes)