quantlab.acquisition.registry.credential_status#

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

Return {variable_name: is_set} for each credential the source names.

The values are booleans only; nothing here returns, logs or masks a credential value.

Parameters:
descriptorSourceDescriptor

The source to check.

Returns:
dict of str to bool

One entry per name in descriptor.required_env, or {} when the source needs no credentials.

Examples

With neither Alpaca variable set in the environment:

>>> from quantlab.acquisition.base import DataSourceRegistry
>>> from quantlab.acquisition.registry import credential_status
>>> credential_status(DataSourceRegistry.get("alpaca"))
{'APCA_API_KEY_ID': False, 'APCA_API_SECRET_KEY': False}