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/zstandard 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')
With zstandard compression using pickle:
df_io.write_df(df, 's3://bucket/dir/mydata.pickle.zstd', fmt='pickle')
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.11.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for df_io-0.0.11-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fe3ff95c6c8c0898289d31bb471e0d2f6fc9337168764512040bf95e0bf483d |
|
MD5 | 64bbfff20117af03bebc062d564e7693 |
|
BLAKE2b-256 | 890be96db1cf4e8383fea75d757b404a537ba52063bfd7821a9cd9574e6b467a |