civis.io.dataframe_to_file
- civis.io.dataframe_to_file(df, name='data.csv', expires_at='DEFAULT', client=None, **to_csv_kws)[source]
Store a
DataFrameas a CSV in Civis Platform- Parameters:
- df
DataFrame The table to upload.
- namestr, optional
The name of the Civis File
- expires_atstr, optional
The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify
None. To specify a date and time, format it by the ISO 8601 standard, e.g.,"2020-12-31","2020-12-31T23:03:40Z", and what theisoformat()method returns from adatetime.dateordatetime.datetimeobject.- client
civis.APIClient, optional If not provided, an
civis.APIClientobject will be created from theCIVIS_API_KEY.- **to_csv_kws
Additional keyword parameters will be passed directly to
to_csv().
- df
- Returns:
- file_idint
The integer ID of the new Civis File object
See also
file_to_civis()to_csv()