policy based variable composition

Joseph L. Casale jcasale at activenetwerx.com
Fri Apr 3 08:32:57 EDT 2020


I am looking to replace a home built solution which allows a program
to derive a series of variable values through configuration or policy.

The existing facility allows dependences so one of the requested variables
can depend on another, they are ordered and computed. It also allows
callbacks so code can be executed.

For example, you would send in a list with any required parameters and out
the other end comes the derived values, eg:

input = [
    ['PROPERTY_FOO', 'PROPERTY_BAR', 'SOME_OTHER_FIELD'],
    {
        'key_a': 42,
        'key_b': 'foo',
        'key_c': 'some text'
    }
]

output = {
    'PROPERTY_FOO': ['foo_42', 99],
    'PROPERTY_BAR': ['some_static_value'],
    'SOME_OTHER_FIELD': ['foo_42__some_static_value']
}

The existing code base works, however the code is utterly abysmal.

Does such a thing exist that is well maintained?

Thanks,
jlc


More information about the Python-list mailing list