Skip to main content

A python API wrapper for Smappee

Project description

# Smappy API wrapper for Smappee

See https://smappee.atlassian.net/wiki/display/DEVAPI/API+Methods

## Create a new connection by supplying your Smappee client id and secret s = smappy.Smappee(client_id, client_secret)

## Authenticate using a Smappee username and password s.authenticate(username, password)

Re-authentication using the refresh token is done automatically when the access token has expired.

## API Requests 4 API requests are supported. The methods return the parsed JSON response as a dict.

### Get Service Locations s.get_service_locations()

### Get Service Location Info s.get_service_location_info(service_location_id)

### Get Consumption s.get_consumption(service_location_id, start, end, aggregation)

Start & End accept epoch (in milliseconds), datetime and pandas timestamps

Aggregation: 1 = 5 min values (only available for the last 14 days), 2 = hourly values, 3 = daily values, 4 = monthly values, 5 = quarterly values

### Get Events s.get_events(service_location_id, appliance_id, start, end, max_number)

## Consumption as Pandas DataFrame s.get_consumption_dataframe(service_location_id, start, end, aggregation, localize)

Same usage as get_consumption, but returns a Pandas DataFrame. Use the localize flag to get localized timestamps.

# Simple Smappee If you have no client id, client secret, refresh token etc, for instance if everything concerning oAuth is handed off to a different process like a web layer. This object only uses a given access token. It has no means of refreshing it when it expires, in which case the requests will raise errors.

ss = SimpleSmappee(access_token)

It has the same methods as the normal Smappee class, except authorization and re-authorization will not work.

# Future Future development may include:

Request error catching and handling.

Implementation of the actuator methods

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

smappy-0.1.1.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

smappy-0.1.1-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

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