Skip to main content

A python package for Kisi API

Project description

Kisi

KISI: The go-to access control app.

This Python library provides convenient access to the Kisi API, allowing you to manage groups, calendars, and cameras programmatically. Kisi is an easy to use cloud based software to manage access to your doors. For physical access use your smartphone's mobile App or secure badges to unlock and open door.

Kisi Shop
About Kisi

Request Feature/Suggestion: https://forms.gle/efGD5DuTpWsX96GG7

Downloads

Installation

pip install kisi

Kisi supports Python 3+.

Usage

Default

import kisi

Authentication

Before making requests, you need to authenticate using your Kisi API key. Initialize the Connect class with your API key:

from kisi import Connect

api_key = 'your_kisi_api_key'
ks = Connect(api_key)

OR

import kisi 

api_key = 'your_kisi_api_key'
ks = kisi.Connect(api_key)

Generate Key from Kisi API

Users

Fetch Users

# Fetch users with optional parameters
users = ks.fetch_users(confirmed=True, group_id=1, limit=20, offset=0)
print(users)

Create User

# Create a new user
new_user = ks.create_user(name='John Doe', email='john@example.com', password='securepassword')
print(new_user)

Fetch User

# Fetch a specific user by user_id
user = ks.fetch_user(user_id=123)
print(user)

Update User

# Update user details
updated_user = ks.update_user(user_id=123, name='John Doe Jr.')
print(updated_user)

Delete User

# Delete a user by user_id
ks.delete_user(user_id=123)

Fetch Current User

# Fetch details of the current authenticated user
current_user = ks.fetch_current_user()
print(current_user)

Update Current User

# Update details of the current authenticated user
updated_current_user = ks.update_current_user(name='Jane Doe')
print(updated_current_user)

Delete Current User

# Delete the current authenticated user
ks.delete_current_user()

Register User

# Register a new user
register_user = ks.register_user(name='Jane Doe', email='jane@example.com', password='securepassword', terms_and_conditions=True)
print(register_user)

Groups

Fetch Groups

# Fetch groups with optional parameters
groups = ks.fetch_groups(limit=10, offset=0)
print(groups)

Create Group

# Create a new group
new_group = ks.create_group(name='Engineering Team')
print(new_group)

Fetch Group

# Fetch a specific group by group_id
group = ks.fetch_group(group_id=1)
print(group)

Update Group

# Update group details
updated_group = ks.update_group(group_id=1, name='DevOps Team')
print(updated_group)

Delete Group

# Delete a group by group_id
ks.delete_group(group_id=1)

Cards

Fetch Cards

# Fetch cards with optional parameters
cards = ks.fetch_cards(limit=10, offset=0)
print(cards)

Create Card

# Create a new card
new_card = ks.create_card(token='token_value', card_type='rfid')
print(new_card)

Fetch Card

# Fetch a specific card by card_id
card = ks.fetch_card(cardIdentifier='card_id_value')
print(card)

Update Card

# Update card details
updated_card = ks.update_card(card_id='card_id_value', two_factor_pin='1234')
print(updated_card)

Delete Card

# Delete a card by card_id
ks.delete_card(card_id='card_id_value')

Locks

Fetch Locks

# Fetch locks with optional parameters
locks = ks.fetch_locks(limit=10, offset=0)
print(locks)

Create Lock

# Create a new lock
new_lock = ks.create_lock(name='Main Entrance', place_id=1)
print(new_lock)

Fetch Lock

# Fetch a specific lock by lock_id
lock = ks.fetch_lock(lock_id=1)
print(lock)

Update Lock

# Update lock details
updated_lock = ks.update_lock(lock_id=1, name='Back Door')
print(updated_lock)

Delete Lock

# Delete a lock by lock_id
ks.delete_lock(lock_id=1)

Cameras

Fetch Cameras

# Fetch cameras with optional parameters
cameras = ks.fetch_cameras(limit=10, place_id=1)
print(cameras)

Create Camera

# Create a new camera
new_camera = ks.create_camera(lock_id=1, remote_id='camera_001', name='Main Lobby Camera')
print(new_camera)

Fetch Camera

# Fetch a specific camera by camera_id
camera = ks.fetch_camera(camera_id=1)
print(camera)

Update Camera

# Update camera details
updated_camera = ks.update_camera(camera_id=1, name='Main Lobby Camera New')
print(updated_camera)

Delete Camera

# Delete a camera by camera_id
ks.delete_camera(camera_id=1)

Calendars

Fetch Summary

# Fetch calendar summary with required parameters
summary = ks.fetch_summary(around='2024-06-17', consequence='consequence_value')
print(summary)### Groups

Fetching Groups

groups = ks.group.fetch_groups()
print(groups)

Creating a Group

new_group = ks.group.create_group(name='Engineering Team', description='Access to engineering floors')
print(new_group)

Fetching a Group

group_info = ks.group.fetch_group(group_id=123)
print(group_info)

Updating a Group

update_result = ks.group.update_group(group_id=123, name='New Name', description='New Description')
print(update_result)

Deleting a Group

delete_result = ks.group.delete_group(group_id=123)
print(delete_result)

Calendars

Fetching Calendar Summary

summary = ks.calendar.fetch_summary(around='2024-06-14', consequence='upcoming')
print(summary)

Cameras

Fetching Cameras

cameras = ks.camera.fetch_cameras()
print(cameras)

Creating a Camera

new_camera = ks.camera.create_camera(lock_id=456, remote_id='abc123', name='Office Camera')
print(new_camera)

Fetching a Camera

camera_info = ks.camera.fetch_camera(camera_id=789)
print(camera_info)

Updating a Camera

update_status = ks.camera.update_camera(camera_id=789, name='Updated Camera')
print(update_status)

Deleting a Camera

delete_status = ks.camera.delete_camera(camera_id=789)
print(delete_status)

License

This project is licensed under the MIT License - see the LICENSE file for details.


This `README.md` provides a structured guide to using your library, including installation instructions, usage examples for each API action (groups, calendars, cameras), and licensing information. Adjust the examples as needed to match the specifics of your API client implementation and usage scenarios.

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

kisi-1.4.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

Kisi-1.4-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file kisi-1.4.tar.gz.

File metadata

  • Download URL: kisi-1.4.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.8

File hashes

Hashes for kisi-1.4.tar.gz
Algorithm Hash digest
SHA256 37c78653f5a192104799aa008bd6bf4e6b8a1b717f184387fd51c58cd2844f3f
MD5 745f5870a6f478695a81853c8b323ae5
BLAKE2b-256 c077121f5fdc9f59db0b266bb39484da49b089916aebe0d16cbd237c5d80d17f

See more details on using hashes here.

File details

Details for the file Kisi-1.4-py3-none-any.whl.

File metadata

  • Download URL: Kisi-1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.8

File hashes

Hashes for Kisi-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6070c2ddcbfbf4bf1179190149fea35e67220ee5cfb0f359dd0f39962d3b7b5e
MD5 7c73cc09ca33a1c620788d6834309553
BLAKE2b-256 15473d55199790befb93a125b389e6a9cbdef65a7d894c03739ad3d481b6fc72

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