项目作者: c7h

项目描述 :
KIWI.KI python client library (unofficial)
高级语言: Python
项目地址: git://github.com/c7h/kiwiki_client.git
创建时间: 2018-05-14T14:16:09Z
项目社区:https://github.com/c7h/kiwiki_client

开源协议:GNU General Public License v3.0

下载


KIWI.KI Client

This is the unofficial KIWI.KI Client Library. Checkout the KIWI.KI API here: https://developer.kiwi.ki/

Example

  1. import json
  2. from kiwiki import KiwiClient, KiwiException
  3. client = KiwiClient(username='foobar@example.com', password='supersecret')
  4. # Get a list of all my doors
  5. my_doors = client.get_locks()
  6. print(json.dumps(my_doors, indent=2, sort_keys=True))
  7. #[
  8. # {
  9. # "address": {
  10. # "city": "Berlin",
  11. # "country": "DE",
  12. # "lat": 52.55657169,
  13. # "lng": 13.66660845,
  14. # "postal_code": "10110",
  15. # "specifier": "SPEC_01",
  16. # "state": "Berlin",
  17. # "street": "Foo Street 23"
  18. # },
  19. # "can_invite": true,
  20. # "hardware_type": "DOOR",
  21. # "highest_permission": "IS_ADMIN",
  22. # "image": null,
  23. # "is_owner": true,
  24. # "sensor_id": 12345,
  25. # "sensor_name": null,
  26. # "sensor_uuid": "unavailable"
  27. # }
  28. #]
  29. # Now, open a door
  30. try:
  31. client.open_door(12345)
  32. except KiwiException as e:
  33. print(e)

Installation

pip install kiwiki-client