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.0.post10.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

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

crawlab_sdk-0.6.0.post10-py3-none-any.whl (53.9 kB view details)

Uploaded Python 3

File details

Details for the file crawlab-sdk-0.6.0.post10.tar.gz.

File metadata

  • Download URL: crawlab-sdk-0.6.0.post10.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.15

File hashes

Hashes for crawlab-sdk-0.6.0.post10.tar.gz
Algorithm Hash digest
SHA256 90d77acf290edc770e5d9d46eac0ff70bf2aa4ff2bead3a0f62c0cc28059e2bf
MD5 d3a443a9f71a5c911e9eb55e8f174a0b
BLAKE2b-256 823d164233944a08f147122ea90e2b83dfa26f641d75291b4cff65de6ad02417

See more details on using hashes here.

File details

Details for the file crawlab_sdk-0.6.0.post10-py3-none-any.whl.

File metadata

File hashes

Hashes for crawlab_sdk-0.6.0.post10-py3-none-any.whl
Algorithm Hash digest
SHA256 d2fa28a219e2a3ab6c8f87ab0deb8dbec1737c9edfa7e43c1805bd8de9f76b24
MD5 da940512f2f7c83b5c72b44dff0646a5
BLAKE2b-256 b9e76ac96a0ccd52a5e546dbd71636d8f22ae9eff86d3d95b62ab6d02056fd0e

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