Skip to main content

BlobHub Python SDK

Overview

BlobHub is a service offering versioned storage of structured data.

BlobHub SDK provides developers with convenient access to the functionality of BlobHub platform.

BlobHub Portal

Registration

Free BlobHub account needs to be created in order to make use of the SDK.

Follow these steps to get started with BlobHub:

  1. Create free BlobHub account at:
    https://blobhub.io/
  2. Create new organization to store your blobs:
    https://blobhub.io/p/me/org/create
  3. Create blob of desired type (see the section on Presets library below for examples).
  4. Under blob's Settings create API key with write access to the blob.

Access Control

Some of the principles in the foundation of BlobHub access model:

  • Blob (and organization holding it) can remain private until it is ready to be exposed for public consumption.
  • Private Blobs can be shared with BlobHub members directly.
  • API keys provide ability to enable mutable access to blob data (via API and SDK).

Blob Types

Blob type defines the structure of the data stored within the blob. It also determines the set of available operations.

The following blob types are supported at the moment:

  • ONNX Model
    Provides storage of deep neural network computational graphs in ONNX format.

Installation

To install, use:

pip install blobhub

Usage

Authentication

Use the following snippet to get access to the blob:

from blobhub.blob import Blob, Revision

blob = Blob(
    org_id="<< organization alias or id >>", 
    blob_id="<< blob alias or id >>", 
    api_key="<< API key from blob settings >>")
revision = blob.revisions.latest()
assert blob[Blob.FIELD_STATUS] == Blob.STATUS_READY
assert revision[Revision.FIELD_STATUS] == Revision.STATUS_READY
assert revision[Revision.FIELD_PHASE] == Revision.PHASE_DRAFT

Presets Library

Presets library is created to simplify operating with blobs of various types (ONNX, OrientDB Graph, etc.).

ONNX Module

ONNX Model blobs are designed to store deep neural network models exported in ONNX format.

Follow these steps to make use of the module:

  • Initialize preset:
from blobhub.presets.onnx import Onnx, Model

onnx = Onnx(revision=revision)
  • Upload local model:
local_model = Model.from_local_file(onnx=onnx, path="/path/to/local/model.onnx")
success = onnx.upload(model=local_model)
assert True == success
  • Download model:
downloaded_model = onnx.download()
assert None != downloaded_model
  • (Optional) Confirm that downloaded model is identical to the original one:
assert downloaded_model.is_identical(model=local_model)

Release files for blobhub 0.1.5

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

Source distribution (sdist)

Source distribution for blobhub 0.1.5
File Size Uploaded
blobhub-0.1.5.tar.gz 11.9 kB Details

Release files / blobhub-0.1.5.tar.gz

Download URL blobhub-0.1.5.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cedb13180b0199a536916b680707f91a69557be539337c93c135c093ae87abc8
BLAKE2b-256 checksum
How to use checksums
748a77cba0350f1a0f7e3f660e069e52ca598339e65d95a9a9e4957ff7a57475
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.5 This release

1 release file

0.1.4

1 release file

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