From 853a28b1488cccbaa371ae88c24ab705d3bbc811 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 23 Feb 2024 09:05:31 -0800 Subject: [PATCH] api_docs: List all Python bindings configuration options. --- api_docs/configuring-python-bindings.md | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/api_docs/configuring-python-bindings.md b/api_docs/configuring-python-bindings.md index 9336596bb5..25720f98f4 100644 --- a/api_docs/configuring-python-bindings.md +++ b/api_docs/configuring-python-bindings.md @@ -5,14 +5,22 @@ easily, called the [Python bindings](https://pypi.python.org/pypi/zulip/). One of the most notable use cases for these bindings are bots developed using Zulip's [bot framework](/api/writing-bots). -In order to use them, you need to configure them with your API key and other -settings. There are two ways to achieve that: +In order to use them, you need to configure them with your identity +(account, API key, and Zulip server URL). There are a few ways to +achieve that: - - With a file called `zuliprc` passed as an argument via the `--config-file` - option. - - With - [environment variables](https://en.wikipedia.org/wiki/Environment_variable) - set up in your host machine. +- Using a `zuliprc` file, referenced via the `--config-file` option or + the `config_file` option to the `zulip.Client` constructor + (recommended for bots). +- Using a `zuliprc` file in your home directory at `~/.zuliprc` + (recommended for your own API key). +- Using the [environment + variables](https://en.wikipedia.org/wiki/Environment_variable) + documented below. +- Using the `--api-key`, `--email`, and `--site` variables as command + line parameters. +- Using the `api_key`, `email`, and `site` parameters to the + `zulip.Client` constructor. ## Download a `zuliprc` file @@ -25,12 +33,6 @@ settings. There are two ways to achieve that: 1. Click the **download** () icon on the profile card of the desired bot to download the bot's `zuliprc` file. -!!! tip "" - - If you save or move a `zuliprc` file to your home directory as `~/.zuliprc`, - the Python API bindings will automatically read it in (you won't have to - pass the `--config-file` option). - !!! warn "" Anyone with a bot's API key can impersonate the bot, so be careful with it! @@ -47,11 +49,9 @@ settings. There are two ways to achieve that: 1. Click **Download zuliprc** to download your `zuliprc` file. -!!! tip "" - - If you save or move a `zuliprc` file to your home directory as `~/.zuliprc`, - the Python API bindings will automatically read it in (you won't have to - pass the `--config-file` option). +1. (optional) If you'd like your credentials to be used by default + when using the Zulip API on your computer, move the `zuliprc` file + to `~/.zuliprc` in your home directory. !!! warn ""