pyrad
RADIUS tools
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 pyraduv
uv add pyradpoetry
poetry add pyradInstalling 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
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
tacacs_plusA TACACS+ client library and command-line tool…
permissive · top 15,000 on PyPI
rtpDecodes, encodes, and manipulates RTP…
permissive · top 15,000 on PyPI
scapyScapy is a Python library for forging,…
copyleft · top 5,000 on PyPI
pmd-net-protoParses, assembles, and validates network…
copyleft · top 15,000 on PyPI
pydivertPyDivert is a Python binding for the WinDivert…
copyleft · top 15,000 on PyPI
oauth2-clientHandles OAuth2 authentication flows…
unclear · top 15,000 on PyPI
pythonpingSends ICMP ping requests to remote hosts from…
permissive · top 15,000 on PyPI
dpktdpkt parses and creates TCP/IP protocol packets…
permissive · top 5,000 on PyPI
pyreqwestA Rust-based HTTP client for Python with both…
unclear · top 15,000 on PyPI
avroApache Avro is a data serialization system that…
permissive · top 5,000 on PyPI