Acquisition
yosoi.policy.Acquisition
class Acquisition(Model):
Authored acquisition mechanism with explicit document selection.
Attributes: kind: direct_http or browser selects the acquisition adapter family. mode: Required headless/headful selection for browser, absent for direct HTTP. documents: Current defaults or exact authored output representations. Direct HTTP supports only a response document.
Source: python/yosoi/policy.py:219
Members below are declared on this class. Inherited Pydantic methods and generated constructor signatures are not expanded.
Fields and class attributes
Section titled “Fields and class attributes”kind: Literal['direct_http', 'browser'] = 'direct_http'
mode: BrowserMode | None = Field(default=None, exclude_if=lambda value: value is None)
documents: DocumentSelection = Field(default_factory=DocumentSelection)
Methods
Section titled “Methods”direct_http
Section titled “direct_http”@classmethod
def direct_http(cls) -> Self:
Return Direct HTTP authoring with current document-selection defaults.
Source: python/yosoi/policy.py:250
browser
Section titled “browser”@classmethod
def browser(cls, mode: Literal['headless', 'headful']='headless') -> Self:
Declare browser acquisition without launching a browser.
Args: mode: Headless or headful selection, defaulting to headless.
Returns: Browser authoring with current document-selection defaults.
Source: python/yosoi/policy.py:255
with_documents
Section titled “with_documents”def with_documents(self, documents: list[str] | tuple[str, ...]) -> Self:
Return a new acquisition with exact authored document outputs.
Args: documents: Supported representations, including an explicit empty selection.
Returns: Revalidated acquisition without changing this declaration.
Raises: PolicyError: The adapter kind or selected document outputs are unsupported.
Source: python/yosoi/policy.py:266
exact_documents
Section titled “exact_documents”@property
def exact_documents(self) -> tuple[str, ...] | None:
Return exact authored outputs, or None for a Current selection.
Source: python/yosoi/policy.py:287
selection_kind
Section titled “selection_kind”@property
def selection_kind(self) -> Literal['current', 'exact']:
Return whether outputs were selected by Current defaults or explicitly.