Data Import and Export
The civis.io
namespace provides several functions for moving data in and
out of Civis.
Tables
Often, your data will be in structured format like a table in a relational
database, a CSV, or a dataframe. The following functions handle moving
structured data to and from Civis. When using these functions, it is
recommended to have pandas
installed and to pass use_pandas=True
in
the appropriate functions. If pandas
is not installed, data returned
from Civis will all be treated as strings.
|
Export data from Civis to a local CSV file. |
|
Unload the result of SQL query and return presigned urls. |
|
Upload the contents of one or more Civis files to a Civis table. |
|
Upload the contents of a local CSV file to Civis. |
|
Upload a pandas dataframe into a Civis table. |
|
Read data from a Civis table. |
|
Read data from Civis using a custom SQL string. |
|
Store results of a query to a Civis file |
|
Split a Redshift 'schema.tablename' string |
Files
These functions will pass flat files to and from Civis. This is useful if you have data stored in binary or JSON format. Any type of file can be stored in platform via the files endpoint.
|
Download a file from Civis. |
|
Store a |
|
Find the file ID of a File run output with the name "name" |
|
Upload a file to Civis. |
|
Load a |
|
Restore JSON stored in a Civis File |
|
Store a JSON-serializable object in a Civis File |
Databases
These functions move data from one database to another and expose an interface
to run SQL in the database. Use query_civis()
when you need to
execute SQL that does not return data (for example, a GRANT
or
DROP TABLE
statement).
|
Transfer a table from one location to another. |
|
Execute a SQL statement as a Civis query. |