--- id: krb5 version: "0.9.0" license: MIT license_treatment: permissive maintenance: aging --- # krb5 — Kerberos API bindings for Python License: permissive · Maintenance: aging · Downloads: 4.8M/mo ## 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 above — verify before relying. Wraps the Kerberos 5 C API to provide Python functions for low-level Kerberos operations, with functions matching the KRB5 API specification. 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 pip install krb5 uv add krb5 poetry add krb5 ## Installing krb5 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. 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 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+. 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_current - Install friction: medium - Maintenance: aging - Downloads: 4.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags kerberos 5 python bindings, krb5 c api wrapper, kerberos authentication library, krb5 context and ticket management, kerberos credential handling, low-level kerberos operations, kerberos, authentication, c-bindings [View on SkillFed](https://skillfed.io/packages/krb5) · [View on PyPI](https://pypi.org/project/krb5/)