API reference¶
- class pylacus.CaptureResponse¶
A capture made by Lacus. With the base64 encoded image and downloaded file decoded to bytes.
- class pylacus.CaptureResponseJson¶
A capture made by Lacus. With the base64 encoded image and downloaded file not decoded.
- class pylacus.CaptureSettings¶
The capture settings that can be passed to Lacus.
- class pylacus.CaptureStatus(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
The status of the capture
PyLacus¶
- class pylacus.PyLacus(root_url: str, useragent: str | None = None, *, proxies: dict[str, str] | None = None)¶
- daily_stats(d: str | date | datetime | None = None, /, *, cardinality_only: bool = True) dict[str, Any] ¶
Get the stats for a specific day (only the last few days are stored in lacus).
- Parameters:
cardinality_only – If True, only return the number of entries in each list (captures, retries, failed retries), instead of the URLs.
- db_status() dict[str, Any] ¶
Gets the database status (number of keys, memory usage)
- enqueue(*, settings: CaptureSettings | None = None) str ¶
- enqueue(*, url: str | None = None, document_name: str | None = None, document: str | None = None, depth: int = 0, browser: Literal['chromium', 'firefox', 'webkit'] | None = None, device_name: str | None = None, user_agent: str | None = None, proxy: str | dict[str, str] | None = None, general_timeout_in_sec: int | None = None, cookies: list[dict[str, Any]] | None = None, headers: str | dict[str, str] | None = None, http_credentials: dict[str, str] | None = None, geolocation: dict[str, float] | None = None, timezone_id: str | None = None, locale: str | None = None, color_scheme: str | None = None, viewport: dict[str, int] | None = None, referer: str | None = None, with_favicon: bool = False, allow_tracking: bool = False, rendered_hostname_only: bool = True, force: bool = False, recapture_interval: int = 300, priority: int = 0, uuid: str | None = None) str
Submit a new capture. Pass a typed dictionary or any of the relevant settings, get the UUID.
- get_capture(uuid: str, *, decode: Literal[True] = True) CaptureResponse ¶
- get_capture(uuid: str, *, decode: Literal[False]) CaptureResponseJson
Get the the capture, with the screenshot and downloaded file decoded to bytes or base64 encoded.
- get_capture_status(uuid: str) CaptureStatus ¶
Get the status of the capture.
- is_busy() bool ¶
Check if the instance is busy.
- property is_up: bool¶
Test if the given instance is accessible
- redis_up() dict[str, Any] ¶
Check if redis is up and running
- status() dict[str, Any] ¶
Get the status of the instance.