Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Loading parameters from environment variables #176

Open
kba opened this issue Oct 22, 2020 · 0 comments
Open

RFC: Loading parameters from environment variables #176

kba opened this issue Oct 22, 2020 · 0 comments

Comments

@kba
Copy link
Member

kba commented Oct 22, 2020

Since this has been requested a few times, here's a proposal how this could work:

In addition to explicit -p/-P CLI options, also look up environment variables that - in uppercase and with dashes replaced by underscore - have the syntax <processor-name>_PARAM_<parameter-name>. The value should be parsed with the same conventions as for -P, i.e. first trying to parse as JSON and use as string literal if that fails.

For example, there would now be three possibilities to specify the model parameter for sbb_binarization:

  • ocrd-sbb-binarize -p '{"model": "/path/to/model"}'
  • ocrd-sbb-binarize -P model /path/to/model
  • OCRD_SBB_BINARIZE_PARAM_MODEL=/path/to/model ocrd-sbb-binarize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant