Helpers for doing IO with Pandas DataFrames
Project description
df_io
Python helpers for doing IO with Pandas DataFrames
Available methods
write_df
This method supports:
- streaming writes
- chunked writes
- gzip compression
- passing parameters to Pandas' writers
- writing to AWS S3 and local files
Examples
Write a Pandas DataFrame (df) to an S3 path in CSV format:
import df_io
df_io.write_df(df, 's3://bucket/dir/mydata.csv')
The same with gzip compression:
df_io.write_df(df, 's3://bucket/dir/mydata.csv.gz')
Using JSON lines (the default):
df_io.write_df(df, 's3://bucket/dir/mydata.json.gz', fmt='json')
Passing writer parameters:
df_io.write_df(df, 's3://bucket/dir/mydata.json.gz', fmt='json', writer_options={'lines': False})
Chunked write (splitting the df into equally sized parts and creating/writing outputs for them):
df_io.write_df(df, 's3://bucket/dir/mydata.json.gz', fmt='json', chunksize=10000)
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
df_io-0.0.1.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for df_io-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2d1c12e810e25c95d5a852b7de1914f4967647c7c62e453ca622657aa98c7dd |
|
MD5 | db91f26da247655f8327df670f662080 |
|
BLAKE2b-256 | b44257b207a2aa911babb1710b551255dbf140078f3849644d07ce98d3996cca |