Python client library for Kanboard
Project description
Client library for Kanboard API.
Author: Frédéric Guillot
License: MIT
Installation
python3 -m pip install kanboard
This library is compatible with Python >= 3.9.
On Fedora (36 and later), you can install the package using DNF:
dnf install python3-kanboard
Examples
Methods and arguments are the same as the JSON-RPC procedures described in the official documentation.
Python methods are dynamically mapped to the API procedures: You must use named arguments.
By default, calls are made synchronously, meaning that they will block the program until completed.
Creating a new team project
import kanboard
with kanboard.Client("http://localhost/jsonrpc.php", "jsonrpc", "your_api_token") as kb:
project_id = kb.create_project(name="My project")
Authenticate as user
import kanboard
with kanboard.Client("http://localhost/jsonrpc.php", "admin", "secret") as kb:
kb.get_my_projects()
Use a custom authentication header
If your Kanboard instance uses a custom authentication header (for example, define('API_AUTHENTICATION_HEADER', 'X-My-Custom-Auth-Header'); in your Kanboard configuration):
import kanboard
with kanboard.Client(url="http://localhost/jsonrpc.php",
username="demo",
password="secret",
auth_header="X-My-Custom-Auth-Header") as kb:
kb.get_me()
Create a new task
import kanboard
with kanboard.Client("http://localhost/jsonrpc.php", "jsonrpc", "your_api_token") as kb:
project_id = kb.create_project(name="My project")
task_id = kb.create_task(project_id=project_id, title="My task title")
Use a personalized user agent
import kanboard
with kanboard.Client(url="http://localhost/jsonrpc.php",
username="admin",
password="secret",
user_agent="My Kanboard client") as kb:
kb.get_my_projects()
Request timeout
By default, requests time out after 30 seconds. You can change this with the timeout parameter (in seconds), or set it to None to disable the timeout:
import kanboard
# Custom 60-second timeout
with kanboard.Client(url="http://localhost/jsonrpc.php",
username="admin",
password="secret",
timeout=60) as kb:
kb.get_my_projects()
Error handling
The client raises kanboard.ClientError for API errors, network failures, and malformed responses:
import kanboard
with kanboard.Client("http://localhost/jsonrpc.php", "jsonrpc", "your_api_token") as kb:
try:
kb.create_project(name="My project")
except kanboard.ClientError as e:
print(e)
SSL connection and self-signed certificates
Example with a valid certificate:
import kanboard
with kanboard.Client("https://example.org/jsonrpc.php", "admin", "secret") as kb:
kb.get_my_projects()
Example with a custom certificate:
import kanboard
with kanboard.Client(url="https://example.org/jsonrpc.php",
username="admin",
password="secret",
cafile="/path/to/my/cert.pem") as kb:
kb.get_my_projects()
Example with a custom certificate and hostname mismatch:
import kanboard
with kanboard.Client(url="https://example.org/jsonrpc.php",
username="admin",
password="secret",
cafile="/path/to/my/cert.pem",
ignore_hostname_verification=True) as kb:
kb.get_my_projects()
import kanboard
with kanboard.Client(url="https://example.org/jsonrpc.php",
username="admin",
password="secret",
insecure=True) as kb:
kb.get_my_projects()
Asynchronous I/O
The client also exposes async/await style method calls. Similarly to the synchronous calls (see above), the method names are mapped to the API methods.
To invoke an asynchronous call, the method name must be appended with _async. For example, a synchronous call to create_project can be made asynchronous by calling create_project_async instead.
import asyncio
import kanboard
async def main():
with kanboard.Client("http://localhost/jsonrpc.php", "jsonrpc", "your_api_token") as kb:
project_id = await kb.create_project_async(name="My project")
print(project_id)
asyncio.run(main())
See the official API documentation for the complete list of methods and arguments.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kanboard-1.1.8.tar.gz.
File metadata
- Download URL: kanboard-1.1.8.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a26e00c7e9e7cb034840fc8505946f4834ff10721da5eae5225cc3b00ce3c7bb
|
|
| MD5 |
a188eff008f6c9d7cff2a32e61ad0ae9
|
|
| BLAKE2b-256 |
d8de0a31e6533512071c54cf37c346fe11e97b0cd85ce9451ce4f5803bfb6a25
|
Provenance
The following attestation bundles were made for kanboard-1.1.8.tar.gz:
Publisher:
publish.yml on kanboard/python-api-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kanboard-1.1.8.tar.gz -
Subject digest:
a26e00c7e9e7cb034840fc8505946f4834ff10721da5eae5225cc3b00ce3c7bb - Sigstore transparency entry: 1178434866
- Sigstore integration time:
-
Permalink:
kanboard/python-api-client@bc88cab3cf8c834c4768ed26fc3c032161ba425d -
Branch / Tag:
refs/tags/1.1.8 - Owner: https://github.com/kanboard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc88cab3cf8c834c4768ed26fc3c032161ba425d -
Trigger Event:
push
-
Statement type:
File details
Details for the file kanboard-1.1.8-py3-none-any.whl.
File metadata
- Download URL: kanboard-1.1.8-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0208db86424488876a2eda51f8aed01fa9df3470e900efd7f2a9b9d578742858
|
|
| MD5 |
63d1f987b157eb0e06feb5a1cf9d13af
|
|
| BLAKE2b-256 |
06837e0207d00effaf988cc6ff4ed06cb46c27524a52a7bbec3710b50dfd9462
|
Provenance
The following attestation bundles were made for kanboard-1.1.8-py3-none-any.whl:
Publisher:
publish.yml on kanboard/python-api-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kanboard-1.1.8-py3-none-any.whl -
Subject digest:
0208db86424488876a2eda51f8aed01fa9df3470e900efd7f2a9b9d578742858 - Sigstore transparency entry: 1178434890
- Sigstore integration time:
-
Permalink:
kanboard/python-api-client@bc88cab3cf8c834c4768ed26fc3c032161ba425d -
Branch / Tag:
refs/tags/1.1.8 - Owner: https://github.com/kanboard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc88cab3cf8c834c4768ed26fc3c032161ba425d -
Trigger Event:
push
-
Statement type: