An open API service indexing awesome lists of open source software.

https://github.com/ail-project/lacuscore

The modulable part of Lacus
https://github.com/ail-project/lacuscore

lacus

Last synced: 3 months ago
JSON representation

The modulable part of Lacus

Awesome Lists containing this project

README

          

[![Documentation Status](https://readthedocs.org/projects/lacuscore/badge/?version=latest)](https://lacuscore.readthedocs.io/en/latest/?badge=latest)

# Modulable Lacus

Lacus, but as a simple module.

# Installation

```bash
pip install lacuscore
```

# Design

`LacusCore` is the part taking care of enqueuing and capturing URLs or web enabled documents.
It can be used as a module in your own project, see below for the usage

[Lacus](https://github.com/ail-project/lacus) is the webservice that uses `LacusCore`,
and you can use [Pylacus](https://github.com/ail-project/pylacus) to query it.

The `enqueue`, `get_capture_status`, and `get_capture` methods if `LacusCore` and `PyLacus` have
the same parameters which means you can easily use them interchangeably in your project.

## Interactive Sessions

`LacusCore` can also manage interactive captures when it is initialized with
`interactive_allowed=True` and `headed_allowed=True`. In that mode, `enqueue(...)`
accepts `interactive=True` (and an optional `interactive_ttl` in seconds,
default 600) and keeps the browser session alive until a trusted caller
triggers the final capture via `request_session_capture(uuid)`.

Interactive session state is split into two layers:

- `get_session_metadata(uuid)` returns the backend-agnostic public state for a
session: status, view URL, lifecycle timestamps, and whether a final capture
has been requested.
- `get_session_backend_metadata(uuid)` returns backend-specific transport data
for trusted local infrastructure only. This is where implementation details
such as xpra unix socket paths belong.

That split keeps API consumers decoupled from the current xpra implementation
while still allowing a local sidecar proxy to connect to the active session.

For more information regarding the usage of the module and a few examples, please refer to
[the documentation](https://lacuscore.readthedocs.io/en/latest/)