Skip to content

API reference

get_all(domain, id, app_token, select='*', where=None, page_size=10000, verbose=True)

Download all records from the query. This is a convenience function for [x for page in get_pages(...) for x in page].

Returns: list of records

get_column_types(domain, id, app_token)

Column names and types. Note that the column types are reported as they are annotated in the dataset. They are not parsed or validated programmatically by cfasodapy, and they may not be accurate.

Returns:

Type Description
list[tuple[str, str]]

list of (field name, data type) pairs

get_pages(domain, id, app_token, select='*', where=None, page_size=10000, verbose=True)

Query a Socrata dataset, page by page

Note that GROUP BY, HAVING, ORDER BY, LIMIT, and OFFSET clauses are not supported.

Parameters:

Name Type Description Default
domain str

base URL

required
id str

dataset ID

required
app_token str

Socrata developer app token

required
select str | Sequence[str]

SELECT clause (string), or a sequence of column names (which will be backtick-quoted and comma-joined).

'*'
where str | None

filter condition

None
page_size int

page size

10000
verbose bool

If True (default), print progress and warnings.

True

Returns: iterator over pages