circuits is a Lightweight Event driven and Asynchronous Application Framework for the Python Programming Language with a strong Component Architecture.

circuits also includes a lightweight, high performance and scalable HTTP/WSGI compliant web server as well as various I/O and Networking components.


  • event driven
  • concurrency support
  • component architecture
  • asynchronous I/O components
  • no required external dependencies
  • full featured web framework (circuits.web)
  • coroutine based synchronization primitives


Hello World!

from __future__ import print_function

from circuits import Component, Event

class hello(Event):
    """hello Event"""

class App(Component):

    def hello(self):
        print("Hello World!")

    def started(self, component):
        raise SystemExit(0)


A simple Echo Server:

from circuits.net.sockets import TCPServer

class EchoServer(TCPServer):

    def read(self, sock, data):
        return data

EchoServer(("", 8000)).run()

A simple Web Application:

from circuits.web import Server, Controller

class Root(Controller):

    def index(self):
        return "Hello World!"

(Server(("", 9000)) + Root()).run()