pamela
PAM interface using ctypes
What it is and what it does
Pamela is a ctypes-based wrapper around the PAM (Pluggable Authentication Modules) system, allowing Python code to authenticate users, open sessions, and manage credentials on Linux and Unix systems. It consolidates functionality from two abandoned projects, adding Python 3 support and more comprehensive PAM call coverage, including session management and informative error handling via PamError exceptions.
The package is used primarily in server contexts where system-level authentication is needed—notably in JupyterHub for user login. It has no external Python dependencies, making it lightweight to install, though it requires the PAM development libraries present on the host system.
Use it for:
- Authenticate users against the system PAM database in web applications or services that need OS-level user validation.
- Manage user sessions in multi-user server environments like JupyterHub where credential handling must integrate with system authentication.
- Implement Kerberos or other PAM-backed authentication mechanisms by resetting credentials after authentication.
- Build system administration tools that need to verify user credentials programmatically without spawning external processes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pamela provides a Python interface to the Linux/Unix PAM (Pluggable Authentication Modules) system, enabling authentication, session management, and credential handling through ctypes bindings.
Yes, if you need PAM authentication in a Python application on Linux/Unix and accept dormant maintenance. The package is stable (no known vulnerabilities, low install friction, permissive license), but the 735-day gap since last commit means security or compatibility fixes are unlikely to arrive quickly. Suitable for production use in established deployments; less suitable if you anticipate needing active upstream support.
Install
pamela on PyPI
pip
pip install pamelauv
uv add pamelapoetry
poetry add pamelaInstalling pamela
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2024-08-09 but no commits in 735 days, though the repository remains active and the package was merged from two abandoned projects to address a specific need.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions, making it safe for most deployment contexts.
Quickstart
pip install pamela
import pamela
# Authenticate a user
try:
pamela.authenticate('username', 'password')
except pamela.PamError as e:
print(f"Authentication failed: {e}")
Requires PAM libraries installed on the system (libpam on Linux); will not work on Windows or systems without PAM support.
Verify before relying
- Whether the package works with modern PAM implementations and recent Linux distributions
- Compatibility with Python versions beyond what the fact sheet specifies
- Whether ctypes bindings remain stable across system PAM library updates
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 735 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 380,725/month — #7,102 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pamela-1.2.0-py2.py3-none-any.whl
Keywords: pam, authentication
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
python-pamPython wrapper for Linux PAM (Pluggable…
permissive · top 5,000 on PyPI
kerberosProvides a high-level Python wrapper for…
permissive · top 5,000 on PyPI
pykerberosProvides a Python wrapper for Kerberos (GSSAPI)…
permissive · top 5,000 on PyPI
requests-kerberosAdds Kerberos/GSSAPI authentication support to…
permissive · top 5,000 on PyPI
requests-negotiate-sspiAdds HTTP Negotiate authentication…
permissive · top 15,000 on PyPI
google-cloud-privilegedaccessmanagerPython client library for Google Cloud…
permissive · top 15,000 on PyPI
python-kadmin-rsPython bindings for Kerberos administration…
permissive · top 15,000 on PyPI
requests-gssapiAdds GSSAPI/Kerberos authentication support to…
permissive · top 15,000 on PyPI
pyobjc-framework-AuthenticationServicesProvides Python bindings to macOS's…
permissive · top 15,000 on PyPI
pyseccomppyseccomp provides a pure-Python interface to…
permissive · top 5,000 on PyPI