Skip to content

Commit 9b1e3e1

Browse files
authored
Usage Examples
1 parent b7c4293 commit 9b1e3e1

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,23 @@ Anecdotally, we use this to load approximately 640 million rows of data from a 7
2323

2424
```python3
2525

26-
from pandas_to_postgres import ...
26+
from pandas_to_postgres import (
27+
DataFrameCopy,
28+
hdf_to_postgres,
29+
multiprocess_hdf_to_postgres,
30+
)
2731

28-
# already loaded dataframe
29-
...
32+
table_model = db.metadata.tables['my_awesome_table']
33+
34+
# already loaded DataFrame & SQLAlchemy Table model
35+
with db.engine.connect() as c:
36+
DataFrameCopy(df, conn=c, table_obj=table_model).copy()
3037

3138
# HDF from file
32-
...
39+
hdf_to_postgres('./data.h5', db)
3340

41+
# Parallel HDF from file
42+
multiprocess_hdf_to_postgres('./data.h5', db, processes=4)
3443
```
3544

3645
# Other Comparisons

0 commit comments

Comments
 (0)