speasy.core.dataprovider module
- class speasy.core.dataprovider.DataProvider(provider_name: str | None = None, provider_alt_names: List[str] | None = None, inventory_disable_proxy=False, min_proxy_version=<Version('0.13.0')>)[source]
Bases:
objectBase class for all data providers.
A provider declares its names as class attributes and registers itself with
register_provider(), which is all Speasy needs to route requests to it.- Parameters:
- provider_name: str or None
The name of the data provider. Defaults to the
NAMEclass attribute, and must match it when both are given.- provider_alt_names: List or None
Alternative names for the data provider, also used to register the provider’s inventory as valid aliases. Defaults to the
ALIASESclass attribute, and must match it when both are given.- inventory_disable_proxy: bool
If True, the inventory will be fetched directly from the provider, bypassing any proxy settings.
- min_proxy_version: str
Minimum required version of the proxy server to use for fetching the inventory.
- build_inventory(root: SpeasyIndex) SpeasyIndex[source]
Override this method to build the inventory tree from the public inventory source.
- build_private_inventory(root: SpeasyIndex) SpeasyIndex[source]
Override this method to add private inventory items that are not fetched from the public inventory source.
- speasy.core.dataprovider.register_provider(cls)[source]
Class decorator making a data provider known to Speasy under its
NAMEandALIASESclass attributes. Atomic: on a name clash nothing is registered.