Skip to main content

Client interface for Scrapinghub HubStorage

Project description

https://badge.fury.io/py/hubstorage.png https://secure.travis-ci.org/scrapinghub/python-hubstorage.png?branch=master

Overview

This is the HubStorage client library, which contains:

  • Full client api trough hubstorage.HubstorageClient

Requirements

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


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.3.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

hubstorage-0.14.3-py2-none-any.whl (16.8 kB view details)

Uploaded Python 2

File details

Details for the file hubstorage-0.14.3.tar.gz.

File metadata

  • Download URL: hubstorage-0.14.3.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hubstorage-0.14.3.tar.gz
Algorithm Hash digest
SHA256 44e0156a7e7eae903d695c5f41e1d8ec5348356690859a8f1b7dbad0f4431feb
MD5 457f144d6e890cc0a30f394ace692cb5
BLAKE2b-256 876e86ce2896c54311f9bc6d7998bf2d32b0ffc80842d6b9812a16a2d6b36330

See more details on using hashes here.

Provenance

File details

Details for the file hubstorage-0.14.3-py2-none-any.whl.

File metadata

File hashes

Hashes for hubstorage-0.14.3-py2-none-any.whl
Algorithm Hash digest
SHA256 79e23e8240681753c5b7a85eaa8aaf73d96ded950094ac6d088bd7baccca7a2d
MD5 6ec4ba636b5c1fc875ab4bf576254713
BLAKE2b-256 ff20d7d3e47bf368a733686830a4eb5265d991e3b8d7e66202692c44a692928e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page