Skip to content

SamuraiT/pandas-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Circle CI

pandas-rs

pandas-rs is oirginally designed for RedShift but also works for PostgreSQL. Inspired by pandas-td

I may should have made the package name as pandas-pg, since It also works for PostgreSQL.

requirement

To connect PostgreSQL and RedShift, you have to have the PostgreSQL client.

Mac

brew update
brew install postgresql

installation

pip install pandas-rs

Usage

As I mentioned, above pandas-rs works for PostgreSQL as well. First export password via shell(recommended)

export REDSHIFT_OR_POSTGRESQL_PASSWORD='password'
import pandas_rs as rs
import os # use only if you will access password through environment variables

rs.create_engine(
    dbname='dev',
    user='test',
    password=os.environ['REDSHIFT_OR_POSTGRESQL_PASSWORD'],
    host='foobar.redshift.exmple',
    port='5439'
)


print(rs.read_sql("""select 'hello PostgreSQL or redshift' greeting"""))

result

         greeting
0  hello PostgreSQL or redshift

About

🐼 Pandas extension for PostgreSQL and RedShift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages