client.tables.list_columns
A method of the Tables endpoint.
- list_columns(id: int, *, name: str = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) ListResponse | PaginatedResponse
List columns in the specified table
API URL:
GET /tables/{id}/columnsimport civis client = civis.APIClient() response = client.tables.list_columns(...)
- Parameters:
- idint
- namestr, optional
Search for columns with the given name, within the specified table.
- limitint, optional
Number of results to return. Defaults to its maximum of 50.
- page_numint, optional
Page number of the results to return. Defaults to the first page, 1.
- orderstr, optional
The field on which to order the result set. Defaults to name. Must be one of: name, order.
- order_dirstr, optional
Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.
- iteratorbool, optional
If True, return a generator (specifically, a
civis.PaginatedResponseobject) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return acivis.ListResponseobject (= a list ofcivis.Responseobjects), whose size is determined by ‘limit’. Defaults to False.
- Returns:
civis.ListResponse|civis.PaginatedResponse- namestr
Name of the column.
- civis_data_typestr
The generic data type of the column (ex. “string”). Since this is database-agnostic, it may be helpful when loading data to R/Python.
- sql_typestr
The database-specific SQL type of the column (ex. “varchar(30)”).
- sample_valuesList[str]
A sample of values from the column.
- encodingstr
The compression encoding for this columnSee: http://docs.aws.amazon.com /redshift/latest/dg/c_Compression_encodings.html
- descriptionstr
The description of the column, as specified by the table owner
- orderint
Relative position of the column in the table.
- min_valuestr
Smallest value in the column.
- max_valuestr
Largest value in the column.
- avg_valuefloat (float)
This parameter is deprecated.
- stddevfloat (float)
This parameter is deprecated.
- value_distribution_percent
civis.Response A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values.
- value_distribution_percent
- coverage_countint
Number of non-null values in the column.
- null_countint
Number of null values in the column.
- possible_dependent_variable_typesList[str]
Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable.
- useable_as_independent_variablebool
Whether the column may be used as an independent variable to train a model.
- useable_as_primary_keybool
Whether the column may be used as an primary key to identify table rows.
- value_distribution
civis.Response An object mapping distinct values in the column to the number of times they appear in the column
- value_distribution
- distinct_countint
Number of distinct values in the column. NULL values are counted and treated as a single distinct value.