skillfed

python-cas

Python CAS client library

python-cas v1.7.2 124.7K downloads/30d#11,856 on PyPI100
Permissive license MIT Active released

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-cas

uv

uv add python-cas

poetry

poetry add python-cas

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Internet :: WWW/HTTP

Tags

CAS client librarycentral authentication servicesingle sign-on SSOCAS protocol implementationweb authentication clientCAS 1.0 2.0 3.0 support
authenticationssocas-protocol

More WWW/HTTP packages