Client library for the Knock API
Project description
Knock Python library
Knock API access for applications written in Python.
Documentation
See the documentation for Python usage examples.
Installation
To install from PyPi, run the following:
pip install knockapi
To install from source, clone the repo and run the following:
python setup.py install
Configuration
To use the library you must provide a secret API key, provided in the Knock dashboard.
from knockapi import Knock
client = Knock(api_key="sk_12345")
Usage
Identifying users
from knockapi import Knock
client = Knock(api_key="sk_12345")
client.users.identify(id="jhammond", data={"name": "John Hammond", "email": "jhammond@ingen.net"})
Retrieving users
from knockapi import Knock
client = Knock(api_key="sk_12345")
client.users.get_user(id="jhammond")
Sending notifies
from knockapi import Knock
client = Knock(api_key="sk_12345")
client.notify(
name="dinosaurs-loose",
actor="dnedry",
recipients=["jhammond", "agrant", "imalcolm", "esattler"],
data={
"type": "trex",
"priority": 1
}
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
knockapi-0.1.0.tar.gz
(3.2 kB
view hashes)