Skip to main content

Python SDK for Crawlab

Project description

Crawlab SDK for Python

中文 | English

The SDK for Python contains two parts:

  1. CLI Tool
  2. Utility Tools

CLI Tool

The CLI Tool is mainly designed for those who are more comfortable using command line tools to interact with Crawlab.

The installation of the CLI Tool is simple:

pip install crawlab-sdk

Then, you can use the crawlab command in the command prompt to action with Crawlab.

Check the help document below, or you can refer to the official documentation (Chinese).

crawlab --help

Utility Tools

Utility tools mainly provide some helper methods to make it easier for you to integrate your spiders into Crawlab, e.g. saving results.

Below are integration methods of Scrapy and general Python spiders with Crawlab.

⚠️Note: make sure you have already installed crawlab-sdk using pip.

Scrapy Integration

In settings.py in your Scrapy project, find the variable named ITEM_PIPELINES (a dict variable). Add content below.

ITEM_PIPELINES = {
    'crawlab.pipelines.CrawlabMongoPipeline': 888,
}

Then, start the Scrapy spider. After it's done, you should be able to see scraped results in Task Detail -> Result

General Python Spider Integration

Please add below content to your spider files to save results.

# import result saving method
from crawlab import save_item

# this is a result record, must be dict type
result = {'name': 'crawlab'}

# call result saving method
save_item(result)

Then, start the spider. After it's done, you should be able to see scraped results in Task Detail -> Result

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

crawlab-sdk-0.6.b20210729-1625.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file crawlab-sdk-0.6.b20210729-1625.tar.gz.

File metadata

  • Download URL: crawlab-sdk-0.6.b20210729-1625.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for crawlab-sdk-0.6.b20210729-1625.tar.gz
Algorithm Hash digest
SHA256 447e6b4904001a7e9fe937dec813395d94f6c760bb68d03ceaa1eb3815ee9f25
MD5 c94622a380af0d02ea99587192af4ade
BLAKE2b-256 31e84cafcd20205eeb4ac7e3d5ecf211c9a2c73a8d80c9b56912093f54fc8311

See more details on using hashes here.

File details

Details for the file crawlab_sdk-0.6b20210729.post1625-py3-none-any.whl.

File metadata

  • Download URL: crawlab_sdk-0.6b20210729.post1625-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for crawlab_sdk-0.6b20210729.post1625-py3-none-any.whl
Algorithm Hash digest
SHA256 6704175004221f23e246727f200c0f1c2938deb2b23bb45d56b4215f825ed095
MD5 8a94c3b0bc5c714c0704aa41c8f0bbf9
BLAKE2b-256 efb957538842920a3b9c3c063642fe2f3f3307b6f831c0af90b5fde8084a2a4a

See more details on using hashes here.

Supported by

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