Skip to main content

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


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)

Uploaded Source

Built Distributions

knockapi-0.1.0-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

knockapi-0.1.0-py2-none-any.whl (4.6 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page