API Reference

This page contains auto-generated API reference documentation for all public functions.

Core Data Access

get_census(dataset, regions[, vectors, ...])

Access Canadian census data through the CensusMapper API.

get_census_geometry(dataset, regions[, ...])

Get census boundary geometries from the CensusMapper API.

get_intersecting_geometries(dataset, level, ...)

Get identifiers for census regions intersecting a geometry.

Dataset Management

list_census_datasets([use_cache, quiet, api_key])

Query the CensusMapper API for available datasets.

dataset_attribution(datasets)

Get combined attribution text for multiple datasets.

Region Operations

list_census_regions(dataset[, use_cache, ...])

Query the CensusMapper API for available regions in a given dataset.

search_census_regions(search_term, dataset)

Search for census regions by name.

as_census_region_list(tbl)

Convert a (suitably filtered) DataFrame from list_census_regions() to a regions dict suitable for passing to get_census().

add_unique_names_to_region_list(region_list)

Add a de-duplicated "Name" column to a region list.

explore_census_regions([dataset])

Open the interactive CensusMapper region explorer in a browser.

Vector/Variable Operations

list_census_vectors(dataset[, use_cache, ...])

Query the CensusMapper API for available vectors for a given dataset.

search_census_vectors(search_term, dataset)

Search for census vectors by name or description.

find_census_vectors(query, dataset[, type, ...])

Find census vectors using exact, semantic, or keyword search.

parent_census_vectors(vectors[, dataset, ...])

Get all parent vectors up the hierarchy for given vectors.

child_census_vectors(vectors[, dataset, ...])

Get all child vectors down the hierarchy for given vectors.

visualize_vector_hierarchy(vector[, ...])

Visualize a census vector hierarchy as an ASCII tree.

label_vectors(x)

Return Census variable names and labels from a data frame.

explore_census_vectors([dataset])

Open the interactive CensusMapper variable explorer in a browser.

Configuration Management

set_api_key(api_key[, install])

Set the CensusMapper API key.

get_api_key()

Get the current CensusMapper API key.

remove_api_key()

Remove the stored API key from both session and persistent storage.

show_api_key()

Display the current API key status.

set_cache_path(cache_path[, install])

Set the local cache path for downloaded data.

get_cache_path()

Get the current cache path.

Cache Management

list_cache()

List all cached data files.

remove_from_cache([cache_keys, all_cache])

Remove items from cache.

clear_cache()

Clear all cached data.

get_recalled_database([refresh])

Fetch the database of recalled data from CensusMapper.

list_recalled_cached_data([cached_data])

List locally cached data that has been recalled by Statistics Canada.

remove_recalled_cached_data()

Remove locally cached data that has been recalled by Statistics Canada.