skillfed

pyrad

RADIUS tools

pyrad v2.5.4 535.4K downloads/30d#6,129 on PyPI309
Permissive license BSD-3-Clause Active released

What it is and what it does

pyrad is a mature, RFC2865-compliant RADIUS client and server library for Python. It abstracts the low-level details of RADIUS packet construction, cryptographic operations (password encryption, message authentication), and network I/O, letting developers focus on authentication logic rather than protocol mechanics. The library handles both client-side authentication requests and server-side response generation, supporting the full AAA (authentication, authorization, accounting) workflow.

The package depends only on netaddr for IP address handling and runs on Python 3.8 or later. It's actively maintained with a stable API, making it suitable for production systems that need to integrate with existing RADIUS infrastructure—common in enterprise networks, ISPs, and access control systems. The codebase has been in active use since 2007, with recent updates addressing modern Python versions.

Use it for:

  • Integrate legacy enterprise authentication systems (Active Directory, FreeRADIUS) into Python applications via RADIUS protocol
  • Build a custom RADIUS server for testing or lab environments without deploying full-scale infrastructure
  • Implement network device authentication (switches, routers, VPN gateways) that speak RADIUS
  • Add AAA (authentication, authorization, accounting) to Python-based access control systems
  • Migrate or bridge authentication between RADIUS and modern identity systems

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pyrad implements RADIUS client and server functionality per RFC2865, handling packet construction, transmission, and response decoding for authentication, authorization, and accounting workflows.

Yes. pyrad is a stable, actively maintained library with low install friction, no known vulnerabilities, and a permissive license. Install it if you need to speak RADIUS protocol—either as a client authenticating against an existing RADIUS server or as a server component in a custom AAA system. The single dependency and broad Python version support make it a low-risk addition to most projects.

Install

pyrad on PyPI

pip

pip install pyrad

uv

uv add pyrad

poetry

poetry add pyrad

Installing pyrad

Before you install

Low friction: pure Python wheel, single runtime dependency (netaddr). Active maintenance with recent commits (last 2026-07-06) and mature codebase (since 2007). Supports Python 3.8 through 3.14.

License in practice

BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; include license text in distributions.

Quickstart

from pyrad.client import Client
from pyrad.dictionary import Dictionary
import pyrad.packet

srv = Client(
    server="localhost",
    secret=b"shared_secret",
    dict=Dictionary("dictionary"),
)
req = srv.CreateAuthPacket(
    code=pyrad.packet.AccessRequest,
    User_Name="username"
)
reply = srv.SendPacket(req)

Requires a RADIUS dictionary file and a reachable RADIUS server to send packets to.

Verify before relying

  • Whether netaddr is a compile-time or pure-Python dependency affecting installation on all platforms
  • Performance characteristics under high-volume packet throughput or concurrent connections

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — netaddr
Maintenance actively maintained — 190 days since the last release
Last repo commit
First released
Downloads 535,414/month — #6,129 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyrad-2.5.4-py3-none-any.whl

Keywords: radius, authentication, AAA, accounting, authorization, RADIUS

Development Status :: 6 - MatureIntended Audience :: DevelopersProgramming 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.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Systems Administration :: Authentication/Directory

Tags

RADIUS client server implementationRFC2865 authentication protocolAAA authentication accountingRADIUS packet handlingnetwork authentication protocolaccess control RADIUSuser authentication server
authenticationnetwork-protocolaaa

More Python Modules packages