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.1

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

Built distribution (wheel)

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

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

Download URL python_keycloak_api_client-0.14.1-py2.py3-none-any.whl
Size 8.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e2befcec10464247eada211781b7dc901f9796075ecf909d5265ea26041336e2
BLAKE2b-256 checksum
How to use checksums
93a5bba8d0c78d201214b3739c0c167deae504c027cfa8f6f9a6fe18e2d4fab9
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

0.14.2

2 release files

This release

0.14.1 This release

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