pyrad 0.8 - native python RADIUS implementation

Wichert Akkerman wichert at
Sat Aug 28 21:09:08 CEST 2004

pyrad is an implementation of a RADIUS client and server as described in
RFC2865, 2866, and others. It takes care of all the details like
building RADIUS packets, sending and receiving them, and en-/decoding
responses. (RADIUS is a common protocol used for authentication,
authorisation and accounting for remote access (and similar) services).

Changes since previous release

* Fix time-handling in the client packet sending code: it would loop
  forever since the now time was updated at the wrong moment. Fix from
  Michael Mitchell.
* Fix passing of dict parameter when creating reply packets


Here is an example of doing a authentication request:

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

  srv=Client(server="", secret="s3cr3t",
        dict=Dictionary("dicts/dictionary", "dictionary.acc"))

                User_Name="wichert", NAS_Identifier="localhost")

  if reply.code==pyrad.packet.AccessAccept:
      print "access accepted"
      print "access denied"

  print "Attributes returned by server:"
  for i in reply.keys():
      print "%s: %s" % (i, reply[i])

And an example for a trivial RADIUS server:

  from pyrad import dictionary, packet, server
  class FakeServer(server.Server):
      def _HandleAuthPacket(self, fd, pkt):
          server.Server._HandleAuthPacket(self, fd, pkt)
          self.SendReplyPacket(fd, reply)
  srv.hosts[""]=server.RemoteHost("", "s3cr3t", "localhost")


pyrad requires Python 2.2 or later.

Author, copyright, availability

pyrad was written by Wichert Akkerman <wichert at>

The current version and documentation can be found at its homepage:

Copyright 2002-2004 Wichert Akkerman. All rights reserved.
pyrad is distributed under the BSD license. Please see the source
archive for the full license text.

Wichert Akkerman <wichert at>    It is simple to make things.                   It is hard to make things simple.

More information about the Python-announce-list mailing list