Skip to content

Sample python application that interacts with the Everactive API

License

Notifications You must be signed in to change notification settings

everactive/python-api-client-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Everactive API Client Sample - Python 3.9

A sample client using Python requests and requests_oauthlib to retrieve a list of sensors from the Everactive Platform API

API Documentation: https://docs.api.everactive.com

Configuration

To use this sample you must have a client_credentials grant_type client_id and client_secret provided by Everactive. These must be assigned to environment variables EVERACTIVE_CLIENT_ID and EVERACTIVE_CLIENT_SECRET, respectively. Additionally, environment variable EVERACTIVE_API_URL must be set to the Everactive API base url.

Running the application

To install the dependencies run

pip install -r requirements.txt

To execute the Steamtrap example

EVERACTIVE_API_URL="https://api.data.everactive.com" \
EVERACTIVE_CLIENT_ID="YOUR CLIENT ID" \
EVERACTIVE_CLIENT_SECRET="YOUR CLIENT SECRET" \
python api_service.py

Running with Docker

In case you don't want to use a local Python environment, a Dockerfile is included that runs the application inside a container.

To Build:

docker build -t python_api/test .

To Run:

docker run \
-it \
--rm \
--env EVERACTIVE_API_URL="https://api.data.everactive.com" \
--env EVERACTIVE_CLIENT_ID="YOUR CLIENT ID" \
--env EVERACTIVE_CLIENT_SECRET="YOUR CLIENT SECRET" \
python_api/test

About

Sample python application that interacts with the Everactive API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •