Metadata-Version: 2.1
Name: lacuscore
Version: 0.4.2
Summary: Core of Lacus, usable as a module
License: BSD-3-Clause
Author: Raphaël Vinot
Author-email: raphael.vinot@circl.lu
Requires-Python: >=3.8,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Telecommunications Industry
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Internet
Classifier: Topic :: Security
Provides-Extra: docs
Requires-Dist: Sphinx (>=5.2.3,<6.0.0); extra == "docs"
Requires-Dist: defang (>=0.5.3,<0.6.0)
Requires-Dist: playwrightcapture (>=1.15.5,<2.0.0)
Requires-Dist: requests (>=2.28.1,<3.0.0)
Requires-Dist: ua-parser (>=0.16.1,<0.17.0)
Description-Content-Type: text/markdown

# 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.


# Usage

The recommended way to use this module is as follows:

1. Enqueue what you want to capture with `enqueue` (it returns a UUID)
2. Trigger the capture itself. For that, you have two options

  * The `capture` method directly, if you pass it the UUID you got from `enqueue`.
    This is what you want to use to do the capture in the same process as the one enqueuing the capture

  * If you rather want to enqueue the captures in one part of your code and trigger the captures in an other one,
    use `consume_queue` which will pick a capture from the queue and trigger the capture.
    I this case, you should use `get_capture_status` to check if the capture is over before the last step.

3. Get the capture result with `get_capture` with the UUID from you got from `enqueue`.

