Skip to main content

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

Metadata

Release files for crawlab-sdk 0.6.0.post10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crawlab-sdk 0.6.0.post10
File Size Uploaded
crawlab-sdk-0.6.0.post10.tar.gz 24.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crawlab-sdk 0.6.0.post10
File Interpreter ABI Platform
crawlab_sdk-0.6.0.post10-py3-none-any.whl Python 3 none any Details

Total release size: 78.7 kB

Release files / crawlab-sdk-0.6.0.post10.tar.gz

Download URL crawlab-sdk-0.6.0.post10.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
90d77acf290edc770e5d9d46eac0ff70bf2aa4ff2bead3a0f62c0cc28059e2bf
BLAKE2b-256 checksum
How to use checksums
823d164233944a08f147122ea90e2b83dfa26f641d75291b4cff65de6ad02417
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.15

Release files / crawlab_sdk-0.6.0.post10-py3-none-any.whl

Download URL crawlab_sdk-0.6.0.post10-py3-none-any.whl
Size 53.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2fa28a219e2a3ab6c8f87ab0deb8dbec1737c9edfa7e43c1805bd8de9f76b24
BLAKE2b-256 checksum
How to use checksums
b9e76ac96a0ccd52a5e546dbd71636d8f22ae9eff86d3d95b62ab6d02056fd0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.15

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.2

2 release files

This release

0.6.0.post10 This release

2 release files

0.6.0

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.5

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page