Skip to main content

This project used for writing WaterCrawl plugins

Project description

Watercrawl Plugin

PyPI version License: MIT

Beta Version

This package is in beta version and we are working on adding more features to it. Please report any issues you find or suggest any changes you would like to see.

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.

Todo List

  • Add support for input validation
  • Add support Pipeline plugins
  • Add support for settings
  • Add support for Download Middleware
  • Add support for Spider Middleware
  • Support json schema validation
  • Better documentation
  • Add support for logging
  • Add support for error handling
  • Add support for testing
  • and anything has more priority from community

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.

Popular Plugins (Examples)

The following plugins are based on this package for WaterCrawl

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.1.0.tar.gz (5.9 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.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for watercrawl_plugin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc73a8dcf5a655233006ea0630771a9e845742a1adcb9d468965facdb9bd9393
MD5 b7876f04002db34983d8324389c3a160
BLAKE2b-256 ffa22048ddc86916013dd207375c058c1acf4d97717fe24de0f22a4c5fa3aae6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for watercrawl_plugin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36f612b4165e87f2fe073ba934318e640ed7a1e62069514fd5c67f9a240d702a
MD5 2f8d0c133fc997ba2aaf0e4f2cc28987
BLAKE2b-256 10fce5126728cf3c12d7dd416aa1a6b73598ce823ad23e3875178a44bb6cd244

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