quantlab.acquisition.registry.is_configured#

quantlab.acquisition.registry.is_configured(descriptor)[source]#

Return whether every credential variable the source names is set.

Answers False rather than raising on an unconfigured machine, and never turns a credential value into anything but this boolean. A variable set to the empty string counts as unset, which matches the check the vendor clients apply when they are constructed.

Parameters:
descriptorSourceDescriptor

The source to check.

Returns:
bool

True if every name in descriptor.required_env is set and non-empty.

Examples

With TIINGO_API_KEY unset in the environment:

>>> from quantlab.acquisition.base import DataSourceRegistry
>>> from quantlab.acquisition.registry import is_configured
>>> is_configured(DataSourceRegistry.get("tiingo"))
False