Bindings for the Zulip message API
Low maintenance activity. Last release 14 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install zulipDependencies
The Zulip API Python bindings require the following dependencies:
- Python (version >= 3.9)
- requests (version >= 0.12.1)
Note: If you'd like to use the Zulip bindings with Python 2, we recommend installing version 0.6.4.
Installing
This package uses setuptools, so you can just run:
python setup.py install
Using the API
For now, the only fully supported API operation is sending a message. The other API queries work, but are under active development, so please make sure we know you're using them so that we can notify you as we make any changes to them.
The easiest way to use these API bindings is to base your tools off of the example tools under zulip/examples/ in this distribution.
If you place your API key in the config file ~/.zuliprc the Python
API bindings will automatically read it in. The format of the config
file is as follows:
[api]
key=<api key from the web interface>
email=<your email address>
site=<your Zulip server's URI>
insecure=<true or false, true means do not verify the server certificate>
cert_bundle=<path to a file containing CA or server certificates to trust>
If omitted, these settings have the following defaults:
insecure=false
cert_bundle=<the default CA bundle trusted by Python>
Alternatively, you may explicitly use "--user", "--api-key", and
--site in our examples, which is especially useful when testing. If
you are running several bots which share a home directory, we
recommend using --config to specify the path to the zuliprc file
for a specific bot. Finally, you can control the defaults for all of
these variables using the environment variables ZULIP_CONFIG,
ZULIP_API_KEY, ZULIP_EMAIL, ZULIP_SITE, ZULIP_CERT,
ZULIP_CERT_KEY, and ZULIP_CERT_BUNDLE. Command-line options take
precedence over environment variables take precedence over the config
files.
The command line equivalents for other configuration options are:
--insecure
--cert-bundle=<file>
You can obtain your Zulip API key, create bots, and manage bots all
from your Zulip settings page; with current Zulip there's also a
button to download a zuliprc file for your account/server pair.
A typical simple bot sending API messages will look as follows: