Giter Site home page Giter Site logo

ail-project / pylacus Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 1.0 268 KB

Python module to enqueue and query a remote Lacus instance

Home Page: https://pylacus.readthedocs.io/en/latest/index.html

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
capture-website lacus playwright

pylacus's People

Contributors

adulau avatar dependabot[bot] avatar rafiot avatar terrtia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pylacus's Issues

fix(README.md) Update API in README.md

Python client and module for Lacus

Use this module to interact with a Lacus instance.

Installation

pip install pylacus

Usage

Command line

You can use the pylacus command:

$ 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

Example api metods

Status of a capture

status = lacus.get_capture_status(uuid)

Capture result

result = lacus.get_capture(uuid)

Full Example

This code utilizes the redis library and the lacuscore and pylacus modules to capture a web page using LacusCore.

Note: Make sure you have properly installed the required dependencies before executing this code.

from redis import Redis
from lacuscore import LacusCore
from pylacus import PyLacus

redis = Redis()
lacus = PyLacus("http://xxx.xx.xxx.xx:7100/")
# Check if the Redis server is up
if lacus.redis_up():
    # Enqueue a capture for the URL(s) you want to capture
    uuid = lacus.enqueue(url='google.com')  # Replace 'google.com' with the desired URL(s)

    # Get the capture result based on the returned UUID
    result = lacus.get_capture(uuid)
    print(result)

Notes:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.