pycancensus.list_census_datasets

pycancensus.list_census_datasets(use_cache: bool = True, quiet: bool = False, api_key: str | None = None) DataFrame[source]

Query the CensusMapper API for available datasets.

Parameters:
  • use_cache (bool, default True) – If True, data will be read from local cache if available.

  • quiet (bool, default False) – When True, suppress messages and warnings.

  • api_key (str, optional) – API key for CensusMapper API. If None, uses environment variable.

Returns:

DataFrame with information about available census datasets including: - dataset: Dataset identifier (e.g., ‘CA16’, ‘CA21’) - description: Human-readable description of the dataset - geo_dataset: Geographic dataset identifier - attribution: Attribution requirements for the dataset

Return type:

pd.DataFrame

Examples

>>> import pycancensus as pc
>>> datasets = pc.list_census_datasets()
>>> print(datasets)