Skip to main content

RedBrick platform Python SDK!

Project description

Introduction

This is an SDK to make integration with the RedBrick platform as easy as possible. This includes uploading and downloading data as well as making your datasets easily available for training. Use this SDK to access your data and labels anywhere you run your code, whether that is on the cloud or locally with a Jupyter Notebook.

Please feel free to submit issues on github or at support@redbrickai.com if you run into any problems or have suggestions.

Quickstart

After creating an account on app.redbrickai.com,

pip install --upgrade redbrick-sdk

You'll need to get your API key before you can utilize the SDK.

"""redbrick quickstart."""
import redbrick

api_key = "<>"
url = "https://api.redbrickai.com"
org_id = "<>"
project_id = "<>"
project = redbrick.get_project(api_key, url, org_id, project_id)

Importing data

There is a single way to import data into your project through the sdk. This is done using the create datapoint api.

An example using a "Public" storage method is given below

# default public storage method
storage_id = "11111111-1111-1111-1111-111111111111"

datapoints = [
    {
        "name": "my first upload",
        "items": [
            "http://datasets.redbrickai.com/car-vids/car-1/frame20.png"
        ]
    }
]
failed_to_create = project.upload.create_datapoints(storage_id, datapoints)


# Datapoint object definition
{
    # REQUIRED: must be unique within a project
    "name": "my first upload",
    # List of urls or item paths, depending on your storage method
    "items": [
        "http://datasets.redbrickai.com/car-vids/car-1/frame20.png"
    ],
    # List of RedBrick Label objects
    "labels":  [<Label object>]

}

Exporting data from your project

import json

result = project.export.redbrick_format()

with open("export.json", "w+") as file_:
    json.dump(file_, result, indent=2)

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

redbrick-sdk-0.6.2.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redbrick_sdk-0.6.2-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

Details for the file redbrick-sdk-0.6.2.tar.gz.

File metadata

  • Download URL: redbrick-sdk-0.6.2.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for redbrick-sdk-0.6.2.tar.gz
Algorithm Hash digest
SHA256 0fc28ad45ef17d8fd169347dd93358d478a882fd07f1cf37f020492662e9f454
MD5 016263eaab16c5693b1729922082b0a3
BLAKE2b-256 d1a8593f692c0a687b9ce43cac8d9a5fd3806d41ded5eb0d0f050ea6b175eb04

See more details on using hashes here.

File details

Details for the file redbrick_sdk-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: redbrick_sdk-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for redbrick_sdk-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 95106eb49efed9cf4bf5b47145ed821ed676efe6d4dfd52348dbecd695af1fc5
MD5 2462ba9572d0e9df866744e34ac56a09
BLAKE2b-256 25b53fcf513fde9f526da200489c5867c6343039e79366b0638043adc4073769

See more details on using hashes here.

Supported by

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