Metadata-Version: 2.1
Name: pylacus
Version: 1.7.3
Summary: Python CLI and module for lacus
Home-page: https://github.com/ail-project/PyLacus
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.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet
Classifier: Topic :: Security
Provides-Extra: docs
Requires-Dist: Sphinx (<7.2) ; (python_version < "3.9") and (extra == "docs")
Requires-Dist: Sphinx (>=7.2,<8.0) ; (python_version >= "3.9") and (extra == "docs")
Requires-Dist: requests (>=2.31.0,<3.0.0)
Project-URL: Documentation, https://pylacus.readthedocs.io/en/latest/index.html
Project-URL: Repository, https://github.com/ail-project/PyLacus
Description-Content-Type: text/markdown

# Python client and module for Lacus

Use this module to interact with a [Lacus](https://github.com/ail-project/lacus) instance.

## Installation

```bash
pip install pylacus
```

## Usage

### Command line

You can use the `pylacus` command:

```bash
$ pylacus -h
usage: pylacus [-h] --url-instance URL_INSTANCE [--redis_up] {enqueue,status,result} ...

Query a Lacus instance.

positional arguments:
  {enqueue,status,result}
                        Available commands
    enqueue             Enqueue a url for capture
    status              Get status of a capture
    result              Get result of a capture.

options:
  -h, --help            show this help message and exit
  --url-instance URL_INSTANCE
                        URL of the instance.
  --redis_up            Check if redis is up.

```

### Library

See [API Reference](https://pylacus.readthedocs.io/en/latest/api_reference.html)

# Example

## Enqueue

```python

from redis import Redis
from lacuscore import LacusCore

redis = Redis()
lacus = lacus = PyLacus("http://127.0.0.1:7100")
uuid = lacus.enqueue('google.fr')
```

## Status of a capture

```python
status = lacus.get_capture_status(uuid)
```

## Capture result

```python
result = lacus.get_capture(uuid)
```

