Skip to main content

Asynchronous Component based Event Application Framework

Project description

Overview

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 web server as well as various I/O and Networking components.

To take full advantage of circuits and it’s architecture, circuits requires that your application be designed in terms of components and their interactions (events) with each other. An application written using the circuits application framework is maintainable, scalable and easy to develop.

The circuits framework has a certain elegance making it a rather attracting feature. New features are built into the framework with this in mind and circuits “eats it’s own dog food” by having a feature-rich library of components built atop the core components.

Documentation: http://packages.python.org/circuits

Project website: https://bitbucket.org/prologic/circuits/

PyPI page: http://pypi.python.org/pypi/circuits

Features

  • event driven

  • concurrency support

  • compnoent archiecture

  • asynchronous I/O components

  • no required external dependencies

  • full featured web framework (circuits.web)

Requirements

circuits has no dependencies beyond the Python Standard Library.

Some dependencies should be optionally installed if deployed on a Python-2.5 environment such as processing for multiprocessing concurrency support and for JSON support the simplejson package.

Installation

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 circuits Page on PyPI or the circuits Downloads page on the circuits Website; extract it and install using:

> python setup.py install

License

circuits is licensed under the MIT License.

Feedback

I welcome any questions or feedback about bugs and suggestions on how to improve circuits. Let me know what you think about circuits. I am on twitter @therealprologic.

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.

Community

There is also a small community of circuits enthusiasts that you may find on the circuits IRC Channel and the circuits Mailing List.

Release Notes

Code Coverage

Code Coverage and Tests need a special section this release. This is the first release where circuits now has the following coverage:

  • Python-2.6: 77%

  • Python-2.5: 76%

We’re well on our way to 100% !!!

Features

  • circuits.app: Revamped environment, config and logger components

  • circuits.net: socket module cleanup.

    • API Changes:

      • Keyword argument ssl changed to secure

      • Attribute ssl changed to ssl

  • circuits.app: Allow the Daemon Component to daemonize an application by simply registering it but only if the application is already running.

  • circuits.app: Import Log Event to circuits.app namespace

  • circuits.core: Cosmetic changes to poller components. Base Poller renamed from _Poller to BasePoller

  • circuits.core: Added new function utils.itercmp which returns an iterator that matches the given component.

  • circuits.net: Added a new Event Closed for Server components which gets sent when the listening socket has closed.

  • circuits.net: Added a _on_stopped event handler to close all client connections on a Server Component and close the connection on a Client Component when the system is terminated.

  • circuits.net: Streamline host and port methods.

  • circuits.web: Streamline host and port methods.

In both cases, the host attribute always returns socket.getsockname()[0]

  • circuits.core: Make default TIMEOUT 10ms This is the timeout period when we have no running Tick Functions.

  • scripts: Added circuits.bench, circuits.sniff and circuis.web scripts which are installed by distutils. circuits.web still gets installed by setuptools.

  • circuits.core: Add an on_ready event handler for the Bridge and set an attribute _bridge on the component being started in “process mode” so we can check whether it’s ready or not via the ready attribute on the Bridge instnace.

  • Makefile: Added graph rule using snakefood and ghostscript to produce a PDF of the architecture of the circuits library.

  • circuits.core: Make chop attribute work for when we’re logging to a logger

  • circuits.web: Set the Content-Type to “application/json” for all JSONController responses.

  • circuits.web: Allow HTTP status message to be customized so implementing WebSockets is a little eaiser.

  • circuits.web: Don’t presume to add a “Content-Type” header.

  • circuits.tools: Added a new helper function tryimport which given a list of modules to try and import and an optional message; will try to import each module returning the first successful one. If none of the modules can be improted, a warning is useed with the optional message.

  • circuits.web: Restructured dispatchers. circuits.web.dispatchers is now it’s own package.

  • circuits.web: NEW WebSockets dispatcher.

  • circuits.web: Raise a RuntimeError exception if when trying to create an instance of the JSONRPC dispatcher we have no “json” support.

  • circuits.web: Raise a RuntimeError exception if when trying to create an instance of the Routes dispatcher we have no “routes” support.

  • circuits.web: Added support for passing body and headers to Request event

  • circuits.web: Only close the connection if Connection header has the value “close” for the Client.

  • circuits.web: Added a _on_write event handler to Client to allow direct writing to the underlying transport (eg: from a WebSockets client).

Bug Fixes

  • circuits.net: Fixed a bug when if we try to initiate a connection on a disconnected socket (eg: TCPClient) we get EBADF or EINVAL.

  • circuits.core: Fixed a bug with Event Handler Inheritence where overridden Event Handlers were not being picked up properly.

  • circuits.core: Fixed a minor bug in @future decorator where it wasn’t passing the correct channel and was starting non-pooled futures as processes instead.

Download files

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

Source Distribution

circuits-1.5.tar.gz (510.5 kB view details)

Uploaded Source

Built Distributions

circuits-1.5-py2.6.egg (393.0 kB view details)

Uploaded Source

circuits-1.5-py2.5.egg (392.6 kB view details)

Uploaded Source

File details

Details for the file circuits-1.5.tar.gz.

File metadata

  • Download URL: circuits-1.5.tar.gz
  • Upload date:
  • Size: 510.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for circuits-1.5.tar.gz
Algorithm Hash digest
SHA256 936c699766fb8b7d3ad3d571e1f132e1119ba75ad877da1514e6f40ec84ad464
MD5 940496ae79464f952f261cf87a20ee90
BLAKE2b-256 0c89f16c6f2ab976010554a91d0566b7684f78cc30646812631d35057ccf9afe

See more details on using hashes here.

File details

Details for the file circuits-1.5-py2.6.egg.

File metadata

  • Download URL: circuits-1.5-py2.6.egg
  • Upload date:
  • Size: 393.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for circuits-1.5-py2.6.egg
Algorithm Hash digest
SHA256 ee48251b1d27e934c65a906a390e2ee66cd8b21763313be5143e157f139760cc
MD5 20b78f6d4f351679e33302af301405a5
BLAKE2b-256 60ecad486c06fb04ee8eca7a12bcc9352fa19d55c00bbdc4d6c388d0133878ef

See more details on using hashes here.

File details

Details for the file circuits-1.5-py2.5.egg.

File metadata

  • Download URL: circuits-1.5-py2.5.egg
  • Upload date:
  • Size: 392.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for circuits-1.5-py2.5.egg
Algorithm Hash digest
SHA256 d671c7215220dd9946146a4d7b51861cec762ef268d5e99e39f8409b5ab73986
MD5 af25b838eede8d4678a8d591b844fd98
BLAKE2b-256 67cc106a88300ca97f64a94cec36662bc11d3f95f48cc272a94bdf1893b05a2c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page