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.push_job(projectid='1111111', spidername='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.16.0.tar.gz
(13.3 kB
view details)
Built Distribution
File details
Details for the file hubstorage-0.16.0.tar.gz
.
File metadata
- Download URL: hubstorage-0.16.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39f929ea70737399327ae552040a29c025aa9ad06797022235960464038cb4e4 |
|
MD5 | 18c8a72a71730fbde5276c6f0ada5612 |
|
BLAKE2b-256 | bf03c1f2ea19b5c010cf0743b6587e526da91351e2e51370514c8da71fe2e67a |
Provenance
File details
Details for the file hubstorage-0.16.0-py2-none-any.whl
.
File metadata
- Download URL: hubstorage-0.16.0-py2-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 513b85e2d7905f4a296b2cd2848b0ff6161611ea8cff76da5ea39fa82a195546 |
|
MD5 | 16deb7e24922edd81934d6ee7305a7eb |
|
BLAKE2b-256 | 57943838637c346c72076641ba5a5dec8c30b68c717dc61f5afeaccd061a6f04 |