Client interface for Scrapinghub HubStorage
Project description
Overview
This is the HubStorage client library, which contains:
Full client api trough hubstorage.HubstorageClient
Requirements
requests: http://pypi.python.org/pypi/requests
Basic API
Example creating a new job:
>>> from hubstorage import HubstorageClient >>> hs = HubstorageClient(auth=apikey) >>> job = hs.new_job(projectid='1111111', spider='foo') >>> job.key '1111111/1/1' >>> job.metadata['state'] 'pending' >>> job.items.write({'title': 'my first item'}) >>> job.logs.info('lorem impsum message are cool') >>> job.logs.error('but sometimes s**t happens') >>> job.finished()
Example getting job data later:
>> job = hs.get_job('1111111/1/1') >> job.metadata['state'] 'finished' >> list(job.items.list(count=1)) [{'title': 'my first item'}] ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hubstorage-0.14.2.tar.gz
(13.1 kB
view hashes)
Built Distribution
Close
Hashes for hubstorage-0.14.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d22a30085e403e1b0c60d514006ce54c5b511453e7c76972720ab2413a350e10 |
|
MD5 | eb7f3984988041bb3f2261a6375473f2 |
|
BLAKE2b-256 | 58f62ccd5e40b6a79ac496468fc28f756d40bc9cf9a29fc86a898e02230a9d0e |