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 (the default):
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:
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.3.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for df_io-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88528ba1a3c78254980fc2503ae15e8b3f6265d51edd89b44b3e4428ab98e85d |
|
MD5 | 88b5c4c1ef678e7c56a9c791986619ba |
|
BLAKE2b-256 | 5689fe39b2a85152870866970d0d4860809f45ab13dff61f33e81c77aa092c1e |