API Client
Client for the Pyronear 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-api.git
$pip install -e pyro-api/client/.
Usage
Import the client
from pyroclient import client
Create a client object by handling him the API keys
API_URL = "http://pyronear-api.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:
#AS A DEVICE:
## Create a device
event_id = api_client.create_event(lat=10, lon=10).json()["id"]
## Create a media
media_id = api_client.create_media_from_device().json()["id"]
## Create an alert linked to the media and the event
api_client.send_alert_from_device(lat=10, lon=10, event_id=event_id, media_id=media_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, image_data=image_data.content)
## Update your position:
api_client.update_my_location(lat=1, lon=2, pitch=3)
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 Pradyun Gedam.
Metadata
Release files for pyroclient 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyroclient-0.1.2.tar.gz | 17.4 kB | Without provenance | Details for pyroclient-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyroclient-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for pyroclient-0.1.2-py3-none-any.whl |
Total release size: 32.6 kB
Release files / pyroclient-0.1.2.tar.gz
| Download URL | pyroclient-0.1.2.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
018843c50463c0fddce711c688729810e86ba7f74c04051bd3e43b641a75e450
|
|
BLAKE2b-256 checksum How to use checksums |
d74191b5aafae718880822639f90285d73765d81ac6d6dcdc18da17ce3ca935b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.13
|
Release files / pyroclient-0.1.2-py3-none-any.whl
| Download URL | pyroclient-0.1.2-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d616f2e2ace2334afa1af2a77325595667172dc48e26cd41eb16c00b7651c60f
|
|
BLAKE2b-256 checksum How to use checksums |
5409f66dfdae4c9020f9cf0253c155e901f463d581f7d324c1a4c7733f656916
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.13
|
Security for pyroclient 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.