base¶
alchemiscale.base.api — reusable components for API services¶
- class alchemiscale.base.api.GufeJSONResponse(*args: Any, **kwargs: Any)¶
Bases:
JSONResponse
- class alchemiscale.base.api.GzipRequest(*args: Any, **kwargs: Any)¶
Bases:
Request
- class alchemiscale.base.api.GzipRoute(*args: Any, **kwargs: Any)¶
Bases:
APIRoute
- class alchemiscale.base.api.QueryGUFEHandler(return_gufe: bool)¶
Bases:
objectHelper class to provide a single-dispatch like handling of the query operations since they can return list or dict.
- alchemiscale.base.api.minimize_scope_space(scopes: list[Scope]) list[Scope]¶
Remove redundant Scopes from a list of Scopes.
- alchemiscale.base.api.validate_scopes(scope: Scope, token: TokenData) None¶
Verify that token data has specified Scope encoded directly or is accessible via scope hierarchy.
- alchemiscale.base.api.validate_scopes_query(query_scope: Scope, token: TokenData, as_str: bool = False) list[Scope] | list[str]¶
Create the intersection of queried scopes and token, where query scopes may include ‘all’ / wildcard (None). No scopes outside of those included in token will be included in scopes returned.
If as_str is True, returns a list of str rather than list of Scopes.
alchemiscale.base.client — base class for API clients¶
- class alchemiscale.base.client.AlchemiscaleBaseClient(api_url: str | None = None, identifier: str | None = None, key: str | None = None, cache_directory: Path | str | None = None, cache_size_limit: int = 1073741824, use_local_cache: bool = True, max_retries: int = 5, retry_base_seconds: float = 2.0, retry_max_seconds: float = 60.0, verify: bool = True)¶
Bases:
objectBase class for Alchemiscale API clients.
- class alchemiscale.base.client.AlchemiscaleBaseClientParam(param_name: str, env_var_name: str, human_name: str, render_value: bool = False)¶
Bases:
objectParameter descriptor for AlchemiscaleBaseClient initialization.
This class encapsulates the validation and rendering logic for client parameters that can be sourced from either explicit arguments or environment variables.