Skip to content

API Reference

Public Package API

nbdctools

NBDCtoolsRError

Bases: RuntimeError

Raised when the underlying R call to NBDCtools fails.

create_dataset(dir_data, study, *, return_mode='polars_sink', **kwargs)

Python wrapper around NBDCtools::create_dataset.

This function forwards all R arguments to the backend implementation and only validates Python-specific return mode behavior.

create_dataset_py(dir_data, dd, vars=None, tables=None, vars_add=None, tables_add=None, format='parquet', categ_to_factor=True, progress=True)

Pure Python dataset joiner based on a data-dictionary dataframe.

Parameters

dd Data dictionary dataframe. Accepts a Polars or pandas DataFrame and must include columns: name, table_name, and identifier_columns.

download_metadata(type='dds', path=None, progress=True)

Download metadata RDS file from NBDCtoolsData r-universe.

load_metadata(path, progress=True)

Load an RDS metadata file into nested dicts and Polars DataFrames.

R-backed wrapper

nbdctools.r_wrapper

create_dataset(dir_data, study, *, return_mode='polars_sink', **kwargs)

Python wrapper around NBDCtools::create_dataset.

This function forwards all R arguments to the backend implementation and only validates Python-specific return mode behavior.

Pure-Python and metadata utilities

nbdctools.pure_python

create_dataset_py(dir_data, dd, vars=None, tables=None, vars_add=None, tables_add=None, format='parquet', categ_to_factor=True, progress=True)

Pure Python dataset joiner based on a data-dictionary dataframe.

Parameters

dd Data dictionary dataframe. Accepts a Polars or pandas DataFrame and must include columns: name, table_name, and identifier_columns.

download_metadata(type='dds', path=None, progress=True)

Download metadata RDS file from NBDCtoolsData r-universe.

load_metadata(path, progress=True)

Load an RDS metadata file into nested dicts and Polars DataFrames.

Exceptions

nbdctools.exceptions

NBDCtoolsRError

Bases: RuntimeError

Raised when the underlying R call to NBDCtools fails.