Skip to main content

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.

Metadata

Release files for pyrostorage 0.1.0

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

Source distribution (sdist)

Source distribution for pyrostorage 0.1.0
File Size Uploaded
pyrostorage-0.1.0.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyrostorage 0.1.0
File Interpreter ABI Platform
pyrostorage-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.1 kB

Release files / pyrostorage-0.1.0.tar.gz

Download URL pyrostorage-0.1.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5c24315828a196ed88eece81a3ee56f036ff5d978520a55aa319d4d98818a69a
BLAKE2b-256 checksum
How to use checksums
3d2a80f8d49c9ca3a1c842899d36be1ec7d9647aad5788b7c38a438dbafc82bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Release files / pyrostorage-0.1.0-py3-none-any.whl

Download URL pyrostorage-0.1.0-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8107a47ae1764a2f79c2af99911c3142504c6b89b1449cbbba4633457c521954
BLAKE2b-256 checksum
How to use checksums
3e41f937c48bfafeaa3d1b7d5fe7fae74741ba783200419ff8842870ee76b765
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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