Skip to main content

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

Release files for basking-sdk 0.9.59

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for basking-sdk 0.9.59
File Size Uploaded
basking_sdk-0.9.59.tar.gz 19.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for basking-sdk 0.9.59
File Interpreter ABI Platform
basking_sdk-0.9.59-py3-none-any.whl Python 3 none any Details

Total release size: 43.6 kB

Release files / basking_sdk-0.9.59.tar.gz

Download URL basking_sdk-0.9.59.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1fccb274668d16f6c55f6e38a8da028fff00d65b12ad7e36f26d80548ead009b
BLAKE2b-256 checksum
How to use checksums
c24335f8cfd433ead6fc0599a1b88ed43e48e7b7ccae75b7341605e95e7645ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.16

Release files / basking_sdk-0.9.59-py3-none-any.whl

Download URL basking_sdk-0.9.59-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb6f1819bd8397ef7c81b5a5598fd978c77d45c385644dfa7539335cba1e0bdb
BLAKE2b-256 checksum
How to use checksums
67b51a4fb46b51f0be31179e43b5fde04749062c76a3772329dab067d299da18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.16

Release history Release notifications | RSS feed

This release

0.9.59 This release

2 release files

0.9.58

2 release files

0.9.57

2 release files

0.9.55

2 release files

0.9.53

2 release files

0.9.52

2 release files

0.9.51

2 release files

0.9.50

2 release files

0.9.49

2 release files

0.9.48

2 release files

0.9.45

2 release files

0.9.44

2 release files

0.9.41

2 release files

0.9.39

2 release files

0.9.38

2 release files

0.9.37

2 release files

0.9.36

2 release files

0.9.35

2 release files

0.9.34

2 release files

0.9.33

2 release files

0.9.32

2 release files

0.9.31

2 release files

0.9.30

2 release files

0.9.29

2 release files

0.9.28

2 release files

0.9.27

2 release files

0.9.21

2 release files

0.9.20

2 release files

0.9.19

2 release files

0.9.18

2 release files

0.9.17

2 release files

0.9.13

2 release files

0.9.12

2 release files

0.9.11

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page