Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Asynchronous Component based Event Application Framework

Project Description

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.

Got questions?



#!/usr/bin/env python

"""circuits Hello World"""

from circuits import Component, Event

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

class App(Component):

    def hello(self):
        """Hello Event Handler"""

        print("Hello World!")

    def started(self, component):
        """Started Event Handler

        This is fired internally when your application starts up and can be used to
        trigger events that only occur once during startup.
        """  # Fire hello Event

        raise SystemExit(0)  # Terminate the Application


Echo Server

#!/usr/bin/env python

"""Simple TCP Echo Server

This example shows how you can create a simple TCP Server (an Echo Service)
utilizing the builtin Socket Components that the circuits library ships with.

from circuits import handler, Debugger
from import TCPServer

class EchoServer(TCPServer):

    def on_read(self, sock, data):
        """Read Event Handler

        This is fired by the underlying Socket Component when there has been
        new data read from the connected client.

        ..note :: By simply returning, client/server socket components listen
                  to ValueChagned events (feedback) to determine if a handler
                  returned some data and fires a subsequent Write event with
                  the value returned.

        return data

# Start and "run" the system.
# Bind to port
app = EchoServer(9000)

Hello Web

#!/usr/bin/env python

from circuits.web import Server, Controller

class Root(Controller):

    def index(self):
        """Index Request Handler

        Controller(s) expose implicitly methods as request handlers.
        Request Handlers can still be customized by using the ``@expose``
        decorator. For example exposing as a different path.

        return "Hello World!"

app = Server(("", 9000))

More examples


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


Supported Platforms

  • Linux, FreeBSD, Mac OS X, Windows
  • Python 2.6, 2.7, 3.2, 3.3, 3.4
  • pypy 2.0, 2.1, 2.2


The simplest and recommended way to install circuits is with pip. You may install the latest stable release from PyPI with pip:

$ pip install circuits

If you do not have pip, you may use easy_install:

$ easy_install circuits

Alternatively, you may download the source package from the PyPi or the Downloads extract it and install using:

$ python install


You can install the development version via pip install circuits==dev.


circuits is licensed under the MIT License.


We welcome any questions or feedback about bugs and suggestions on how to improve circuits.

Let us know what you think about circuits. @pythoncircuits.

Do you have suggestions for improvement? Then please Create an Issue with details of what you would like to see. I’ll take a look at it and work with you to either incorporate the idea or find a better solution.


There are also several places you can reach out to the circuits community:


Whilst I (James Mills) continue to contribute and maintain the circuits project I do not represent the interests or business of my employer Facebook Inc. The contributions I make are of my own free time and have no bearing or relevance o Facebook Inc.

Release History

Release History

This version
History Node


History Node


History Node


History Node

History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
circuits-3.2-py2-none-any.whl (151.6 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Jun 2, 2016
circuits-3.2.tar.gz (174.3 kB) Copy SHA256 Checksum SHA256 Source Jun 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting