Skip to main content

Python Client for Pyronear data curation API

Project description

API Client

Build Status Docs

Client for the data curation API

Getting started

Prerequisites

  • Python 3.6 (or more recent)
  • pip

Installation

You can clone and install the project dependencies as follows:

$git clone https://github.com/pyronear/pyro-storage.git
$pip install -e pyro-storage/client/.

Usage

Import the client

from pyrostorage import client

Create a client object by handling him the API keys

API_URL = "http://pyronear-storage.herokuapp.com"
CREDENTIALS_LOGIN = "George Abitbol"
CREDENTIALS_PASSWORD = "AStrong Password"
api_client = client.Client(API_URL, CREDENTIALS_LOGIN, CREDENTIALS_PASSWORD)

Use it to query alerts:

## Create a media
media_id = api_client.create_media().json()["id"]

## Upload an image on the media
dummy_image = "https://ec.europa.eu/jrc/sites/jrcsh/files/styles/normal-responsive/" \
                + "public/growing-risk-future-wildfires_adobestock_199370851.jpeg"
image_data = requests.get(dummy_image)
api_client.upload_media(media_id=media_id, media_data=image_data.content)

## Create an annotation
dummy_annotation = "https://raw.githubusercontent.com/anishathalye/imagenet-simple-labels/" \
					+ "master/imagenet-simple-labels.json"
annotation_id = api_client.create_annotation(media_id=media_id).json()["id"]
annot_data = requests.get(dummy_annotation)
api_client.upload_annotation(annotation_id=annotation_id, annotation_data=annot_data.content)

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

Documentation

The full project documentation is available here for detailed specifications. The documentation was built with Sphinx using a theme provided by Read the Docs.

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

pyrostorage-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

pyrostorage-0.1.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file pyrostorage-0.1.0.tar.gz.

File metadata

  • Download URL: pyrostorage-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for pyrostorage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5c24315828a196ed88eece81a3ee56f036ff5d978520a55aa319d4d98818a69a
MD5 2a50f4c00a8e471ea66942adffc44e48
BLAKE2b-256 3d2a80f8d49c9ca3a1c842899d36be1ec7d9647aad5788b7c38a438dbafc82bc

See more details on using hashes here.

File details

Details for the file pyrostorage-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyrostorage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for pyrostorage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8107a47ae1764a2f79c2af99911c3142504c6b89b1449cbbba4633457c521954
MD5 fad00f8921d88cb0512a22845613e68f
BLAKE2b-256 3e41f937c48bfafeaa3d1b7d5fe7fae74741ba783200419ff8842870ee76b765

See more details on using hashes here.

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