Client interface for Scrapinghub HubStorage
Project description
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.10.tar.gz
(10.6 kB
view details)
File details
Details for the file hubstorage-0.10.tar.gz
.
File metadata
- Download URL: hubstorage-0.10.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecbc52e567df4be23475adb7a95bf84ed1fd26c9c72e693eca15556881273696 |
|
MD5 | a0cac6f6cf7f7869030e235a7adf74f2 |
|
BLAKE2b-256 | 88a62a90ec0b17548353e954417edb9cffee855134a8529d7c2e11d19442eefb |