Skip to main content

This project used for writing WaterCrawl plugins

Project description

Watercrawl Plugin

PyPI version License: MIT

Description

WaterCrawl plugin is a Python package that provides a base for creating plugins for the WaterCrawl web crawling framework. It offers abstract classes and interfaces to standardize plugin development.

Installation

You can install the WaterCrawl plugin package using pip:

pip install watercrawl-plugin

Usage To create a new plugin for Watercrawl, you need to extend the base classes provided by this package. Here's a basic guide on how to create a new plugin:

Import the necessary classes:

from watercrawl_plugin import AbstractPlugin, AbstractPipelinePlugin, AbstractInputValidator

Create your plugin class by extending AbstractPlugin:

class MyPlugin(AbstractPlugin):
    @classmethod
    def get_name(cls) -> str:
        return "MyPlugin"

    @classmethod
    def get_description(cls) -> str:
        return "This is my custom plugin for WaterCrawl"

    @classmethod
    def get_version(cls) -> str:
        return "0.1.0"

    @classmethod
    def get_author(cls) -> str:
        return "Your Name"

    @classmethod
    def get_pipeline_class(cls):
        return MyPipelinePlugin

    @classmethod
    def get_input_validator(cls):
        return MyInputValidator

Create a pipeline plugin by extending AbstractPipelinePlugin:

class MyPipelinePlugin(AbstractPipelinePlugin):
    def process_item(self):
        # Implement your item processing logic here
        # You can access self.item, self.spider, self.crawler_service, and self.helpers
        pass

Create an input validator by extending AbstractInputValidator:

class MyInputValidator(AbstractInputValidator):
    def validate(self):
        # Implement your input validation logic here
        # You can access self.crawler_service, self.helpers, and self.errors
        pass

API Reference

For detailed information about the base classes and their methods, refer to the source code in src/watercrawl_plugin/base.py.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

watercrawl_plugin-0.0.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

watercrawl_plugin-0.0.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file watercrawl_plugin-0.0.2.tar.gz.

File metadata

  • Download URL: watercrawl_plugin-0.0.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for watercrawl_plugin-0.0.2.tar.gz
Algorithm Hash digest
SHA256 974f011d1501d5d9771e92e55b50b0794082bd2050d3172ca5fce41c8cb3d907
MD5 d55f83ff75a11de8a91fb1667400273d
BLAKE2b-256 33af6c2fd5d3c6f0f1ac3cac976430cccb58e88eee5e8114e7150926fe22d5ba

See more details on using hashes here.

File details

Details for the file watercrawl_plugin-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for watercrawl_plugin-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 35f38c5f0384b69edc7625d358d9a27d0ac3e6072a192f662bbda5212f3b97ba
MD5 f8b66bb5b4769942e71853f79eb42cc1
BLAKE2b-256 621f20bd03c214f494ddf78eba84b7ae95bb15d4dc9a895e8145fb195f3e7724

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page