Skip to content

Commit

Permalink
Usage Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bleonard33 authored Jul 13, 2018
1 parent b7c4293 commit 9b1e3e1
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,23 @@ Anecdotally, we use this to load approximately 640 million rows of data from a 7

```python3

from pandas_to_postgres import ...
from pandas_to_postgres import (
DataFrameCopy,
hdf_to_postgres,
multiprocess_hdf_to_postgres,
)

# already loaded dataframe
...
table_model = db.metadata.tables['my_awesome_table']

# already loaded DataFrame & SQLAlchemy Table model
with db.engine.connect() as c:
DataFrameCopy(df, conn=c, table_obj=table_model).copy()

# HDF from file
...
hdf_to_postgres('./data.h5', db)

# Parallel HDF from file
multiprocess_hdf_to_postgres('./data.h5', db, processes=4)
```

# Other Comparisons
Expand Down

0 comments on commit 9b1e3e1

Please sign in to comment.