client.imports.get_files_csv

A method of the Imports endpoint.

get_files_csv(id: int) Response

Get a CSV Import

API URL: GET /imports/files/csv/{id}

import civis
client = civis.APIClient()
response = client.imports.get_files_csv(...)
Parameters:
idint
Returns:
civis.Response
  • idint

    The ID for the import.

  • namestr

    The name of the import.

  • sourcecivis.Response
    • file_idsList[int]

      The file ID(s) to import, if importing Civis file(s).

    • storage_pathcivis.Response
      • storage_host_idint

        The ID of the source storage host.

      • credential_idint

        The ID of the credentials for the source storage host.

      • file_pathsList[str]

        The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).

  • destinationcivis.Response
    • schemastr

      The destination schema name.

    • tablestr

      The destination table name.

    • remote_host_idint

      The ID of the destination database host.

    • credential_idint

      The ID of the credentials for the destination database.

    • primary_keysList[str]

      A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.

    • last_modified_keysList[str]

      A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.

  • first_row_is_headerbool

    A boolean value indicating whether or not the first row of the source file is a header row.

  • column_delimiterstr

    The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • escapedbool

    A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.

  • compressionstr

    The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.

  • existing_table_rowsstr

    The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.

  • max_errorsint

    The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.

  • table_columnsList[civis.Response]

    An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table.

    • namestr

      The column name.

    • sql_typestr

      The SQL type of the column.

  • loosen_typesbool

    If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.

  • executionstr

    In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.

  • redshift_destination_optionscivis.Response
    • diststylestr

      The diststyle to use for the table. One of “even”, “all”, or “key”.

    • distkeystr

      Distkey for this table in Redshift

    • sortkeysList[str]

      Sortkeys for this table in Redshift. Please provide a maximum of two.

  • hiddenbool

    The hidden status of the item.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.