open-contracting / ocdskit

A suite of command-line tools for working with OCDS data
https://ocdskit.readthedocs.io
BSD 3-Clause "New" or "Revised" License
17 stars 6 forks source link

mapping-sheet: Add codelist column to output #183

Closed duncandewhurst closed 2 years ago

duncandewhurst commented 2 years ago

In order to know which fields permit translated values, it would be useful if there was a column to indicate which fields use codelists.

Some fields use codelists but don't include a link to the codelist in the field description, e.g. Observation.unit.scheme.

jpmckinney commented 2 years ago

Do you just need a boolean or the name of the codelist?

duncandewhurst commented 2 years ago

For this use case, a boolean would be sufficient. However, the name of the codelist might be useful for other purposes so I'd favour that option. We could also add a column for whether the codelist is open or closed.

jpmckinney commented 2 years ago

You can try ocdskit mapping-sheet --codelist --infer-required my-schema.json with pip install -e git+https://github.com/open-contracting/ocdskit.git

jpmckinney commented 2 years ago

The presence of format (which lists the enum) is an indicator of a closed codelist.

jpmckinney commented 2 years ago

Hold on - need to commit a fix. Update: Done.

duncandewhurst commented 2 years ago

Looks good! Thanks

jpmckinney commented 2 years ago

Cool, 1.0.4 is building and will be available shortly.