Babel extractors

Babel extractors can be specified in configuration files.

For OCDS, you can specify in babel_ocds_codelist.cfg:

[ocds_codelist: schema/*/codelists/*.csv]
headers = Title,Description,Extension
ignore = currency.csv

and in babel_ocds_schema.cfg:

[ocds_schema: schema/*/*-schema.json]

For BODS, you can specify in babel_bods_codelist.cfg:

[ocds_codelist: schema/codelists/*.csv]
headers = title,description,technical note

and in babel_bods_schema.cfg:

[ocds_schema: schema/*.json]

For OC4IDS, you can specify in a Babel .cfg file:

[extractors]
yaml = ocds_babel.extract:extract_yaml
[yaml: mapping/sustainability.yaml]
keys = title,disclosure format,mapping
ocds_babel.extract.extract_codelist(fileobj, keywords, comment_tags, options)[source]

Yield each header, and the values of the specified fields of a codelist CSV file.

ocds_babel.extract.extract_schema(fileobj, keywords, comment_tags, options)[source]

Yield the “title” and “description” values of a JSON Schema file.

ocds_babel.extract.extract_extension_metadata(fileobj, keywords, comment_tags, options)[source]

Yield the “name” and “description” values of an extension.json file.

ocds_babel.extract.extract_yaml(fileobj, keywords, comment_tags, options)[source]

Yield the values of the specified keys of a YAML file.