basking-sdk


Namebasking-sdk JSON
Version 0.9.52 PyPI version JSON
download
home_pagehttps://basking.io
SummaryBasking.io python SDK
upload_time2024-01-23 12:58:10
maintainer
docs_urlNone
authorBasking Automation GmbH
requires_python>=3.7, <4
license
keywords occupancy analytics data api bas basking basking.io
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://app.basking.io)

## 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`)

```
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](https://basking.io/contact-us/)


            

Raw data

            {
    "_id": null,
    "home_page": "https://basking.io",
    "name": "basking-sdk",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7, <4",
    "maintainer_email": "",
    "keywords": "occupancy analytics data api bas basking basking.io",
    "author": "Basking Automation GmbH",
    "author_email": "info@basking.io",
    "download_url": "https://files.pythonhosted.org/packages/3c/60/5c70663353eef348e1d36d54b841399c4d39fecdaf2c535a2b636a293699/basking-sdk-0.9.52.tar.gz",
    "platform": null,
    "description": "# Basking.io SDK\n\nIntegrate your data with the Basking API, customize the reports & experience,\nand join the community of developers building with workplace software apps together with Basking.\n\nBasking.io is a cloud based workplace occupancy platform.\nMore Information about Basking can be found here: https://basking.io\n\nBasking uses a GraphQL API. The following Python SDK is a wrapper around the production API\ndesigned for our customers that require to access to data programmatically.\n\n## Requirements\n\n* python >=3.7 (current tested version: 3.9)\n* pipenv\n* A [basking.io account](https://app.basking.io)\n\n## Getting started\n\n#### set the following environment variables:\n* `BASKING_USERNAME`: Your username (usually your email)\n* `BASKING_USER_PASSWORD`: Your password for Basking. \n* _Optional_: `BASKING_AWS_REGION`: the aws region where your Basking.io instance is hosted. (Defaults to `eu-central-1`)\n* _Optional_: `BASKING_API_URL`: the url of the Basking API you would like to query. (Defaults to `api.basking.io`)\n\n```\nimport logging\nfrom basking.basking_sdk import Basking\n\n# set the default logging\nlogging.basicConfig()\n\n# mofify the required level of logging for Basking\nlogging.getLogger('Basking').setLevel(logging.INFO)\nlogging.getLogger('botocore').setLevel(logging.INFO)\n\n# initialize the SDK and set general query parameters\nbasking_client = Basking()\n\n# list buildings the current user has access to\ndf_buildings = basking_client.location.get_user_buildings(pandify=True)\n\n# get building meta data\nbuilding_meta_data = basking_client.location.get_building(\nbuilding_id=building_id\n)\ntz_str = building_meta_data['data']['getBuilding']['timeZone']\n\n\n# get building daily occupancy statistics\ndf_daily = basking_client.occupancy.get_building_occupancy_stats_daily(\nbuilding_id=building_id,\nstart_obj_tz_unaware=start_date_obj,\nend_obj_tz_unaware=end_date_obj,\npandify=True\n)\ndf_daily.to_csv('./df_daily.csv')\n```\n\n\nFor more examples, see `basking.api_usage_example`, or [contact us](https://basking.io/contact-us/)\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Basking.io python SDK",
    "version": "0.9.52",
    "project_urls": {
        "Bug Reports": "https://basking.io/contact-us/",
        "Homepage": "https://basking.io"
    },
    "split_keywords": [
        "occupancy",
        "analytics",
        "data",
        "api",
        "bas",
        "basking",
        "basking.io"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "012c3d439baa2293a38545a06f320804bfc5fb1a681f5f49ca1fefb0bf56c6e4",
                "md5": "b6f5be8a9f0db66afcca9780b67d5038",
                "sha256": "4b130fd2bcb5607e85ae0b9923a3527e119fc8731892132f906923bf141f779b"
            },
            "downloads": -1,
            "filename": "basking_sdk-0.9.52-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b6f5be8a9f0db66afcca9780b67d5038",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7, <4",
            "size": 22808,
            "upload_time": "2024-01-23T12:58:08",
            "upload_time_iso_8601": "2024-01-23T12:58:08.072204Z",
            "url": "https://files.pythonhosted.org/packages/01/2c/3d439baa2293a38545a06f320804bfc5fb1a681f5f49ca1fefb0bf56c6e4/basking_sdk-0.9.52-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c605c70663353eef348e1d36d54b841399c4d39fecdaf2c535a2b636a293699",
                "md5": "cd1c0f6322405041f6173644f28026ef",
                "sha256": "8e2e25e0803562811dea9b56d04c11cce2f557a20949357530333940ab82ee1f"
            },
            "downloads": -1,
            "filename": "basking-sdk-0.9.52.tar.gz",
            "has_sig": false,
            "md5_digest": "cd1c0f6322405041f6173644f28026ef",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7, <4",
            "size": 17806,
            "upload_time": "2024-01-23T12:58:10",
            "upload_time_iso_8601": "2024-01-23T12:58:10.132917Z",
            "url": "https://files.pythonhosted.org/packages/3c/60/5c70663353eef348e1d36d54b841399c4d39fecdaf2c535a2b636a293699/basking-sdk-0.9.52.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-23 12:58:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "basking-sdk"
}
        
Elapsed time: 0.22852s