API reference

CensoBR.fetchcensus — Function
fetchcensus(year, uf, record; cachedir=_defaultcachedir(),
		   force=false, showprogress=true)

Returns the path of the processed Parquet file.

If a processed Parquet file is not already cached, CensoBR downloads and extracts the corresponding Census archive, parses the fixed-width microdata, writes the result to Parquet, and removes the temporary raw files.

Use uf="BR" to process and stack every federative unit into a national dataset for the requested year and record.

See also fieldmetadata, fieldlabel, fieldvalues, and fieldnotes

source
CensoBR.fieldmetadata — Function
fieldmetadata(year::Integer, record::Symbol, variable::Symbol)

Return metadata for variable in the specified Census year and record.

The returned named tuple contains:

  • labels: descriptive label for the variables, or nothing if unavailable.
  • values: mapping from coded values to their descriptions.
  • notes: additional notes associated with the variable.

See also fieldlabel, fieldvalues, and fieldnotes.

source
CensoBR.fieldvalues — Function
fieldvalues(year::Integer, record::Symbol, variable::Symbol)

Return the coded values and their descriptions for variable in the specified Census year and record.

The result is a Dict{String,String} mapping codes to their corresponding descriptions. For fields whose raw codes are split across multiple variables, the dictionary uses the complete reference code described in the field notes. Returns an empty dictionary when no coded values are defined.

See also fieldmetadata, fieldlabel, and fieldnotes.

source
CensoBR.fieldnotes — Function
fieldnotes(year::Integer, record::Symbol, variable::Symbol)

Return additional notes for variable in the specified Census year and record.

The result is a Vector{String}. Returns an empty vector when no notes are available.

See also fieldmetadata, fieldlabel, and fieldvalues.

source