krb5
Kerberos API bindings for Python
Decision gist · record as of 2026-08-14
Yes, if you need direct Kerberos 5 API access and have the required system dependencies (Kerberos implementation + C compiler). No, if you want simpler Kerberos authentication—use python-gssapi instead. The package is stable (MIT license, no known vulnerabilities, active repository) but aging (262 days since last release) and marked Beta. Install friction is medium due to compiled dependencies.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Kerberos 5 implementation (MIT Kerberos 1.17+ or Heimdal) with development headers and C compiler, except on macOS when using pre-built wheels.
- Python 3.9+.
- Medium install friction due to compiled C extension requirements.
License · maintenance · safety
MIT (permissive) — MIT license is permissive and imposes no restrictions on use, modification, or distribution in proprietary or open-source contexts.
last release 2025-11-25 (262 days) · last repo commit 2025-11-25 · 21 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,788,678 downloads/mo, #2,230 on PyPI
Alternatives
Verify before relying
pip install krb5
import krb5
ctx = krb5.init_context()
# Use context for Kerberos operations- Thread safety guarantees and limitations under free-threading mode (PEP 779)
- Behavioral differences and error handling across MIT Kerberos vs. Heimdal implementations
- Production readiness status (Development Status is Beta)
What it is and what it does
krb5 is a direct Python wrapper around the Kerberos 5 C API, exposing low-level functions for Kerberos operations. It strips the `krb5_` prefix from standard KRB5 functions—for example, `krb5_init_context()` becomes `krb5.init_context()`—and raises `Krb5Error` exceptions with formatted error messages and codes. The library returns Python classes for KRB5 structures, which are automatically freed when dereferenced; some expose an `addr` property to pass raw pointers to other libraries like python-gssapi.
The package requires either MIT Kerberos (minimum 1.17) or Heimdal with development headers and a C compiler to build from source; macOS users can install pre-built wheels without compilation. Not all functions are available on every KRB5 implementation, so callers must check availability at runtime. The library supports Python 3.9+ and includes beta-level support for Python free-threading (PEP 779). The description explicitly recommends using python-gssapi for simpler Kerberos authentication workflows.
Use it for
- Build low-level Kerberos authentication systems where direct KRB5 API control is needed
- Integrate Kerberos credential and ticket management into Python applications
- Pass KRB5 structures to other libraries (like python-gssapi) via the addr property
- Develop Kerberos-aware network services that require fine-grained context and credential handling
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need direct Kerberos 5 API access and have the required system dependencies (Kerberos implementation + C compiler).
No, if you want simpler Kerberos authentication—use python-gssapi instead. The package is stable (MIT license, no known vulnerabilities, active repository) but aging (262 days since last release) and marked Beta. Install friction is medium due to compiled dependencies.
Install
krb5 on PyPI
Before you install
Medium install friction due to compiled C extension requirements. Needs a Kerberos 5 implementation (MIT Kerberos 1.17+ or Heimdal) and C compiler on most platforms; macOS wheels avoid compilation if installing pre-built. Last release 262 days ago; repository active but aging.
Requires Kerberos 5 implementation (MIT Kerberos 1.17+ or Heimdal) with development headers and C compiler, except on macOS when using pre-built wheels. Python 3.9+.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution in proprietary or open-source contexts.
Quickstart
pip install krb5
import krb5
ctx = krb5.init_context()
# Use context for Kerberos operations
Verify before relying
- Thread safety guarantees and limitations under free-threading mode (PEP 779)
- Behavioral differences and error handling across MIT Kerberos vs. Heimdal implementations
- Production readiness status (Development Status is Beta)
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Aging 262 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,788,678 / month, #2,230 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Free Threading :: 2 - Beta |
Evidence: krb5-0.9.0-cp310-cp310-macosx_10_9_x86_64.whl; krb5-0.9.0-cp310-cp310-macosx_11_0_arm64.whl; krb5-0.9.0-cp311-abi3-macosx_10_9_x86_64.whl; krb5-0.9.0-cp311-abi3-macosx_11_0_arm64.whl; krb5-0.9.0-cp314-cp314t-macosx_10_15_x86_64.whl; krb5-0.9.0-cp314-cp314t-macosx_11_0_arm64.whl; krb5-0.9.0-cp39-cp39-macosx_10_9_x86_64.whl; krb5-0.9.0-cp39-cp39-macosx_11_0_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “krb5 c api wrapper”
- krb5Wraps the Kerberos 5 C API to provide Python functions for low-level…
- k5testk5test sets up isolated Kerberos 5 test environments and provides…
- python-kadmin-rsPython bindings for Kerberos administration (kadm5), enabling remote…
Give your agent the search over MCP, or paste the wish link into any chat.
More Security packages
Provides Python bindings to the FreeDesktop.org Secret Service API for securely storing and retrieving passwords and secrets through GNOME Keyring, KWallet, or KeePassXC.
MSAL for Python handles OAuth2 and OpenID Connect authentication with Microsoft identity services, managing token acquisition, caching, and refresh for applications integrating with Microsoft Entra ID, Microsoft Accounts, and Azure AD B2C.
joserfc implements JOSE standards (JWS, JWE, JWK, JWT, and related RFCs) for signing, encrypting, and managing JSON-based cryptographic tokens in Python.
Authlib provides a complete implementation of OAuth 1.0, OAuth 2.0, and OpenID Connect 1.0 for building both authentication clients and servers, with built-in support for JWS, JWK, JWA, and JWT standards.
Provides low-level CFFI bindings to the official Argon2 password hashing algorithm for use by libraries and applications that need direct access to Argon2 without higher-level abstractions.
ADAL for Python authenticates applications with Azure Active Directory to obtain tokens for accessing Azure AD-protected resources.
Install only if maintaining existing code that already depends on it, and plan a migration.
See also gssapi · k5test · python-kadmin-rs · sspilib · pyspnego · requests-gssapi · requests-credssp · requests-kerberos · smbprotocol · minikerberos