python-cas
Python CAS client library
What it is and what it does
Python CAS is a client library for the CAS (Central Authentication Service) protocol, extracted from the django-cas-ng project to work independently with any Python web framework. It handles authentication by communicating with a CAS server, supporting protocol versions 1.0, 2.0, and 3.0. The library abstracts away the protocol details so developers can integrate single sign-on (SSO) authentication into Django, Flask, Pyramid, FastAPI, Tornado, or other Python web applications without building the CAS protocol layer themselves.
The package depends on requests for HTTP communication and lxml for XML parsing of CAS server responses. It targets modern Python versions (3.10 and later) and is actively maintained with a stable release history since 2015. Installation is straightforward via pip with minimal dependencies, making it suitable for adding SSO capability to existing web applications.
Use it for:
- Add single sign-on authentication to a Flask or Django application using an existing CAS server.
- Integrate CAS-based authentication into a FastAPI or Pyramid web service for centralized user management.
- Verify CAS tickets and retrieve authenticated user information in a custom Python web application.
- Migrate authentication from a framework-specific CAS plugin to a framework-agnostic client library.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements a CAS (Central Authentication Service) protocol client that works with any Python web framework to authenticate users against a CAS server.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It fills a clear need for CAS protocol support across any Python web framework. Install it if you need to authenticate against a CAS server and want a lightweight, framework-independent solution.
Install
python-cas on PyPI
pip
pip install python-casuv
uv add python-caspoetry
poetry add python-casInstalling python-cas
Before you install
Low install friction with only two runtime dependencies (requests and lxml). Active maintenance with a recent release 101 days ago and ongoing commits; classified as Production/Stable.
License in practice
MIT license is permissive, allowing use in most commercial and open-source projects with minimal restrictions.
Quickstart
pip install python-cas
from python_cas.client import CASClient
client = CASClient(service_url='http://your-app.example.com')
user = client.verify_ticket('ticket-from-cas-server')
Requires Python 3.10 or later.
Verify before relying
- Whether the package's CASClient API is documented with concrete examples beyond the Flask sample mentioned.
- Support status for CAS server versions beyond 3.0 or any known compatibility limitations.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — requests, lxml |
| Maintenance | actively maintained — 101 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 124,683/month — #11,856 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_cas-1.7.2-py3-none-any.whl
Keywords: cas, cas2, cas3, client, sso, single sign-on, authentication, auth
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
python3-samlTurns a Python application into a SAML 2.0…
permissive · top 5,000 on PyPI
djangosaml2Integrates SAML2 single sign-on authentication…
permissive · top 15,000 on PyPI
python-openidImplements OpenID authentication for Python…
permissive · top 15,000 on PyPI
flask-oidcAdds OpenID Connect authentication support to…
permissive · top 5,000 on PyPI
Flask-BasicAuthFlask-BasicAuth adds HTTP basic access…
permissive · top 15,000 on PyPI
django-esiDjango-ESI provides a Django app that wraps the…
copyleft · top 15,000 on PyPI
djangosaml2idp2Implements the SAML 2.0 Identity Provider side…
permissive · top 15,000 on PyPI
webargswebargs parses and validates HTTP request…
permissive · top 5,000 on PyPI
django-google-ssoAdds Google OAuth 2.0 authentication to Django…
permissive · top 15,000 on PyPI
fastapi-ssoFastAPI plugin that adds single sign-on (SSO)…
permissive · top 5,000 on PyPI