Skip to main content

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

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 to eu-central-1)
  • Optional: BASKING_API_URL: the url of the Basking API you would like to query. (Defaults to api.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


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.59.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basking_sdk-0.9.59-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file basking_sdk-0.9.59.tar.gz.

File metadata

  • Download URL: basking_sdk-0.9.59.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.16

File hashes

Hashes for basking_sdk-0.9.59.tar.gz
Algorithm Hash digest
SHA256 1fccb274668d16f6c55f6e38a8da028fff00d65b12ad7e36f26d80548ead009b
MD5 5b2d7af46aae6e1885caaed6caa86918
BLAKE2b-256 c24335f8cfd433ead6fc0599a1b88ed43e48e7b7ccae75b7341605e95e7645ae

See more details on using hashes here.

File details

Details for the file basking_sdk-0.9.59-py3-none-any.whl.

File metadata

  • Download URL: basking_sdk-0.9.59-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.16

File hashes

Hashes for basking_sdk-0.9.59-py3-none-any.whl
Algorithm Hash digest
SHA256 fb6f1819bd8397ef7c81b5a5598fd978c77d45c385644dfa7539335cba1e0bdb
MD5 cfb725f0ea0d90daa6516737ff20b99b
BLAKE2b-256 67b51a4fb46b51f0be31179e43b5fde04749062c76a3772329dab067d299da18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page