Skip to main content

Processors

The processor reads files from current/, yields records, applies steps, and writes to the destination. processor.config.type selects the source reader when it is not obvious from the file extension (zipxml, xlsx, csv, …).

Steps​

StepWhat it does
keymapRename fields (type: names) or assign names by position
typemapConvert values (int, float, date, datetime, bool)
autotypeInfer int/float/bool/date from a record sample
autoidWrite a stable _id (opt-in; default is off)
customPython process(record) in a project-local script

error_strategy is skip, fail, or retry. Failed or skipped records go to output/errors.jsonl.

Example ZIP+XML with keymap and typemap:

processor:
config:
type: zipxml
tagname: Документ
keymap:
type: names
fields:
НаимОрг: orgname
ИННЮЛ: inn
typemap:
date_formed: datetime
date_doc: datetime

Excel with headers and a custom cleaner:

processor:
config:
start_line: 1
autoid: true
autotype: true
keys: territory,years,id,kpp,fullname
custom:
type: script
code: scripts/cleaner.py
def process(r):
r['years'] = r['years'].split()
return r

The script must resolve inside the project directory. See Security.

YAML details: Processor configuration.