Skip to content

hbsir.api.setup

Set up package data for the given years.

This function handles downloading or generating the required data tables to enable full functionality of the package for the specified years.

By default, it tries to download pre-cleaned data which allows the package to work out of the box. But advanced users can generate data locally from raw survey files for more control, transparency or customization.

Parameters:

Name Type Description Default
years _Years

The years of data to set up.

required

Other Parameters:

Name Type Description
replace bool

Whether to re-download or re-generate data if it already exists.

method (create_from_raw, download_cleaned)

The method to use for setting up data.

download_source (original, mirror)

Where to download data from.

Returns:

Type Description
None

The function executes setup tasks but does not return anything.

Examples:

Basic usage:

import lfsir

lfsir.setup(years="1390-1400")

Advanced usage:

lfsir.setup(years="1390-1400",
           method="create_from_raw",
           replace=True)

This will recreate all tables from 1390 to 1400 from raw data even if they already exist.