Skip to main content

Python Keycloak API client

PyPI version CircleCI

This library wraps the Keycloak REST API, providing an easy way to manage users, clients, and other Keycloak resources. It’s simple, extendable, and has been tested in production.

Usage

Install

$ pip install python-keycloak-api-client

Example

from keycloak_api_client import KeycloakApiClient

client = KeycloakApiClient(
    keycloak_url: "https://auth.myservice.com",
    realm: "myservice",
    admin_username: "my_keycloak_admin",
    admin_password: "...",
    admin_client_id: "my_service_backend_client_id",
    admin_client_secret: "...",
    relative_path: "/auth",
)

read_kc_user = client.get_keycloak_user_by_email('johndoe@myservice.com')
read_kc_user.email      # johndoe@myservice.com
read_kc_user.enabled    # True
read_kc_user.first_name # John
read_kc_user.last_name  # Doe
...

Development

Test

# Run linter and tests for all Python versions
$ tox

Linter

# Format
$ ruff format

# Check
$ ruff check

Install

$ pip install -e .

Changelog

CHANGELOG

License

MIT

Metadata

Release files for python-keycloak-api-client 0.14.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-keycloak-api-client 0.14.2
File Size Uploaded
python_keycloak_api_client-0.14.2.tar.gz 41.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-keycloak-api-client 0.14.2
File Interpreter ABI Platform
python_keycloak_api_client-0.14.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 49.5 kB

Release files / python_keycloak_api_client-0.14.2.tar.gz

Download URL python_keycloak_api_client-0.14.2.tar.gz
Size 41.4 kB
Tags Source
SHA-256 checksum
How to use checksums
182950bef26cc6606420c213b1d809b585dc0bf00a6b0c70d087bf0d620f4bfc
BLAKE2b-256 checksum
How to use checksums
c57e6b073ee46d81ba887044fc9465adf2fb2a34afafb3e209950ed6b334a8fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release files / python_keycloak_api_client-0.14.2-py2.py3-none-any.whl

Download URL python_keycloak_api_client-0.14.2-py2.py3-none-any.whl
Size 8.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
7bead2636e88f9cdfe0c25b6f73cc7a3ecafe2cc6f176d7775d49bd6e76134f0
BLAKE2b-256 checksum
How to use checksums
6e3a238e74ce1ccf9829fa9d6e13638d843501c533454f36000e92eb6594e7b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.14.2 This release

2 release files

0.14.1

1 release file

0.13.1

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page