Basking.io python SDK
Project description
Basking.io SDK
Integrate your data with the Basking API, customize the reports & experience, and join the community of developers building with workplace software apps together with Basking.
Basking.io is a cloud based workplace occupancy platform. More Information about Basking can be found here: https://basking.io
Basking uses a GraphQL API. The following Python SDK is a wrapper around the production API designed for our customers that require to access to data programmatically.
Requirements
- python >=3.7 (current tested version: 3.9)
- pipenv
- A basking.io account
Getting started
set the following environment variables:
BASKING_USERNAME
: Your username (usually your email)BASKING_USER_PASSWORD
: Your password for Basking.- Optional:
BASKING_AWS_REGION
: the aws region where your Basking.io instance is hosted. (Defaults toeu-central-1
) - Optional:
BASKING_API_URL
: the url of the Basking API you would like to query. (Defaults toapi.basking.io
)
import logging
from basking.basking_sdk import Basking
# set the default logging
logging.basicConfig()
# mofify the required level of logging for Basking
logging.getLogger('Basking').setLevel(logging.INFO)
logging.getLogger('botocore').setLevel(logging.INFO)
# initialize the SDK and set general query parameters
basking_client = Basking()
# list buildings the current user has access to
df_buildings = basking_client.location.get_user_buildings(pandify=True)
# get building meta data
building_meta_data = basking_client.location.get_building(
building_id=building_id
)
tz_str = building_meta_data['data']['getBuilding']['timeZone']
# get building daily occupancy statistics
df_daily = basking_client.occupancy.get_building_occupancy_stats_daily(
building_id=building_id,
start_obj_tz_unaware=start_date_obj,
end_obj_tz_unaware=end_date_obj,
pandify=True
)
df_daily.to_csv('./df_daily.csv')
For more examples, see basking.api_usage_example
, or contact us
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
basking-sdk-0.9.26.tar.gz
(17.4 kB
view hashes)
Built Distributions
Close
Hashes for basking_sdk-0.9.26-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b2f5e2c079060bfe5f69383a944926bf30d74ad8e23c6101e867103013c9477 |
|
MD5 | 2b709a105f78d5542f12736ab43d40bf |
|
BLAKE2b-256 | 4be7ee3f6e0ea35c5fa8712f5c20117447e8bbfa9c37517ab5d312978d57678e |
Close
Hashes for basking_sdk-0.9.26-0.9.26-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4ada8a122dc64d5c20a83a84ff53b96301d6f663a162955e2f0e6e856cf9f3c |
|
MD5 | 113f41bc2abf7828593615e00cf6997b |
|
BLAKE2b-256 | 53c024053ef4fbd54751850660ec50c2ffde52195c7ff792193522980e86543c |