Skip to main content

Pass postgres data to pandas dataframe

Project description

DFTOPO

How to Install

pip install dftopo

Import into your code

from dftopo import dfps

Examples

Connection.

dbname='your_dbname'
user='your_user'
password='your_password'
host='your_host'
port='your_port'
schema='your_schema1,your_schema2'

engine = dfps.connection(dbname,user,password,host,port,schema)

Pure SQL.

query = f"""
    SELECT * FROM your_schema1.your_table
    """

list(dfps.query_execution(query, engine))

Read data from postgres in python.

query = f"""
    SELECT * FROM your_schema2.your_table
    """

df = dfps.read(query, engine)

Load data from python to Postgres.

dfps.load(df,"test2", engine,'your_schema1')
dfps.load(df,"test2", engine,'your_schema2')

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

dftopo-1.0.6.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

dftopo-1.0.6-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

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