Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ail-project/pylacus
Python module to enqueue and query a remote Lacus instance
https://github.com/ail-project/pylacus
capture-website lacus playwright
Last synced: 4 months ago
JSON representation
Python module to enqueue and query a remote Lacus instance
- Host: GitHub
- URL: https://github.com/ail-project/pylacus
- Owner: ail-project
- License: bsd-3-clause
- Created: 2022-09-21T08:46:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-10T15:07:22.000Z (4 months ago)
- Last Synced: 2024-10-10T15:15:39.685Z (4 months ago)
- Topics: capture-website, lacus, playwright
- Language: Python
- Homepage: https://pylacus.readthedocs.io/en/latest/index.html
- Size: 354 KB
- Stars: 5
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 pylacus import PyLacusredis = Redis()
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)
```