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)
from basking.basking_sdk import Basking
logger.info('initialize the SDK. See constructor documentation for parameter overrides')
basking = Basking()
logger.info('List sites the current user has access to')
sites = basking.location.get_user_buildings(pandify=False)
logger.info('Select a site from the list of sites')
site_id = sites[0]['id']
organization_id = sites[0]['organizationId']
start_date_obj = date(2025, 1, 1)
end_date_obj = date(2025, 1, 14)
logger.info('get site meta data')
site_meta_data = basking.location.get_building(
building_id=site_id
)
logger.info('get building daily occupancy statistics')
df_daily = basking.occupancy.get_building_occupancy_stats_daily(
building_id=site_id,
start_date=start_date_obj,
end_date=end_date_obj,
pandify=True,
# floor_ids=[site_meta_data['data']['getBuilding']['floors'][0]['id']]
)
logger.info('metadata for all site areas')
areas_meta_data = basking.location.get_floor_areas_for_building(
building_id=site_id
)
logger.info('get the density of the last 7 days')
density_last_week = basking.occupancy.get_density_for_building_last_days(
building_id=site_id,
days=7
)
logger.info('Frequency of Visits at Site Level')
df_freq_of_visits = basking.occupancy.get_location_frequency_of_visits(
building_id=site_id,
start_date=start_date_obj,
end_date=end_date_obj,
pandify=True
)
logger.info('Duration of Visits at Site Level')
df_duration_of_visits = basking.occupancy.get_location_duration_of_visits(
building_id=site_id,
start_date=start_date_obj,
end_date=end_date_obj,
pandify=True
)
logger.info('Popular Visitation days at Site Level')
df_preferred_visit_day = basking.occupancy.get_location_popular_days_of_visits(
building_id=site_id,
start_date=start_date_obj,
end_date=end_date_obj,
pandify=True
)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file basking-sdk-0.9.57.tar.gz.
File metadata
- Download URL: basking-sdk-0.9.57.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b413cf2bb5dc4d5c39b9d4dce60637d4b157afceac9572a7dad499ce57f5246
|
|
| MD5 |
df818ca112bb2bab0d215707d908b31e
|
|
| BLAKE2b-256 |
52c42ca198af2ec3f2a76b75bce911a76ad7cf8036b2fa3e66ff3f4edfe54e00
|
File details
Details for the file basking_sdk-0.9.57-py3-none-any.whl.
File metadata
- Download URL: basking_sdk-0.9.57-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35b4c9565a8606335c0fded3c9489e2b84fd2a4d5eb6cc2e9c4725427d42be02
|
|
| MD5 |
30c0bf9bb9b837bc27361c3f60665595
|
|
| BLAKE2b-256 |
dd1f5cabfeda16a1be3b0f44a01dfa138c4ab11016e522e36d5664a9c189410f
|