YAML configuration file

A single YAML file describes the document, the BO filters and the output column typing. It is loaded by boapi.config.load_export_config() and consumed by boapi.api.export_from_config().

Full example

examples/s_lieuprel.yaml
# Export configuration for the BO document S_LIEUPRELSL.
# Used by boapi.export_from_config(...).

doc_id:
  dev: null
  prod: 123456

output: out/s_lieuprel.parquet
chunk_size: 10000
dataprovider: s_lieuprel
date_format: "%d/%m/%Y"

# BO filters, keyed by parameter id (see describe_document_parameters / step 1).
# Parameter 1 is exclusive: 2026-05-01 means up to 2026-04-30 included.
filters:
  '0': ['2026-04-24T00:00:00.000Z']
  '1': ['2026-05-01T00:00:00.000Z']

# Output column typing. Unlisted columns are kept as-is (pandas inference).
columns:
  id_lieu_prel: str
  id_ens: str
  lat: {type: float}
  lon: {type: float}
  date_prel: {rename: date_prelevement, type: datetime, format: "%d/%m/%Y"}

Keys

doc_id

Document identifier. A scalar value, or a mapping by environment (qualif: / prod:) resolved with the env argument.

output

Output file path. The extension sets the format (.parquet / .csv / .json). The parent directory is created if needed.

chunk_size

Number of rows per batch for the parquet export (bounded memory usage).

dataprovider

Name of the dataprovider targeted by the filters.

date_format

Default date format for datetime columns (overridden by format at the column level).

filters

BO parameters, keyed by parameter id (see step 1). The value is a list of strings. Date bounds follow the format expected by BO, for example '2026-04-24T00:00:00.000Z'.

columns

Column typing and renaming. Columns not listed are kept as-is (pandas inference). Three forms:

columns:
  id_lieu_prel: str                 # shorthand: type only
  lat: {type: float}
  date_prel: {rename: date_prelevement, type: datetime, format: "%d/%m/%Y"}

Recognized types: str, int, float, bool, category, datetime.

Automatic generation

The skeleton can be produced from a document with boapi.api.generate_export_config() (or the examples/02_generate_config.py script):

from boapi import generate_export_config

yaml_text = generate_export_config("123456", env="prod", with_columns=True)
print(yaml_text)