circuits


Namecircuits JSON
Version 3.2.3 PyPI version JSON
download
home_pagehttp://circuitsframework.com/
SummaryAsynchronous Component based Event Application Framework
upload_time2024-04-03 22:50:19
maintainerNone
docs_urlhttps://pythonhosted.org/circuits/
authorJames Mills
requires_python>=3.7
licenseMIT
keywords event framework distributed concurrent component asynchronous
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. _Python Programming Language: http://www.python.org/
.. _#circuits IRC Channel: https://web.libera.chat/#circuits
.. _Libera.Chat IRC Network: https://libera.chat
.. _Python Standard Library: http://docs.python.org/library/
.. _MIT License: http://www.opensource.org/licenses/mit-license.php
.. _Create an Issue: https://github.com/circuits/circuits/issues/new
.. _Mailing List: http://groups.google.com/group/circuits-users
.. _Website: http://circuitsframework.com/
.. _PyPi: http://pypi.python.org/pypi/circuits
.. _Documentation: http://circuits.readthedocs.org/en/latest/
.. _Downloads: https://github.com/circuits/circuits/releases
.. _Ask a Question: http://stackoverflow.com/questions/ask
.. _Stackoverflow: http://stackoverflow.com/

.. image:: https://github.com/circuits/circuits/actions/workflows/python-app.yml/badge.svg
   :target: https://github.com/circuits/circuits/actions/workflows/python-app.yml
   :alt: Build Status

.. image:: https://codecov.io/gh/circuits/circuits/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/circuits/circuits
  :alt: Coverage

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.

- `Website`_
- `Downloads`_
- `Documentation`_

Got questions?

- `Ask a Question`_ (Tag it: ``circuits-framework``)


Examples
--------

Hello
.....


.. code:: python

    #!/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.
            """

            self.fire(hello())  # Fire hello Event

            raise SystemExit(0)  # Terminate the Application

    App().run()


Echo Server
...........


.. code:: python

    #!/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 circuits.net.sockets import TCPServer


    class EchoServer(TCPServer):

        @handler("read")
        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 0.0.0.0:8000
    app = EchoServer(8000)
    Debugger().register(app)
    app.run()


Hello Web
.........


.. code:: python

    #!/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(("0.0.0.0", 8000))
    Root().register(app)
    app.run()


More `examples <https://github.com/circuits/circuits/tree/master/examples>`_...



Features
--------

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


Requirements
------------

- circuits has no dependencies beyond the `Python Standard Library`_.


Supported Platforms
-------------------

- Linux, FreeBSD, Mac OS X, Windows
- Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12
- pypy (the newer the better)


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
`PyPi`_ or the `Downloads`_ extract it and install using::

    $ python setup.py install


.. note::
    You can install the `development version
    <https://github.com/circuits/circuits/archive/master.zip#egg=circuits-dev>`_
    via ``pip install circuits==dev``.


License
-------

circuits is licensed under the `MIT License`_.


Feedback
--------

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

Let us know what you think about circuits. `@pythoncircuits <http://twitter.com/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.


Community
---------

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

- `Mailing List`_
- `#circuits IRC Channel`_ on the `Libera.Chat IRC Network`_
- `Ask a Question`_ on `Stackoverflow`_ (Tag it: ``circuits-framework``)

----

Disclaimer
----------

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
to Facebook Inc.

            

Raw data

            {
    "_id": null,
    "home_page": "http://circuitsframework.com/",
    "name": "circuits",
    "maintainer": null,
    "docs_url": "https://pythonhosted.org/circuits/",
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "event framework distributed concurrent component asynchronous",
    "author": "James Mills",
    "author_email": "prologic@shortcircuit.net.au",
    "download_url": "http://bitbucket.org/circuits/circuits/downloads/",
    "platform": "POSIX",
    "description": ".. _Python Programming Language: http://www.python.org/\n.. _#circuits IRC Channel: https://web.libera.chat/#circuits\n.. _Libera.Chat IRC Network: https://libera.chat\n.. _Python Standard Library: http://docs.python.org/library/\n.. _MIT License: http://www.opensource.org/licenses/mit-license.php\n.. _Create an Issue: https://github.com/circuits/circuits/issues/new\n.. _Mailing List: http://groups.google.com/group/circuits-users\n.. _Website: http://circuitsframework.com/\n.. _PyPi: http://pypi.python.org/pypi/circuits\n.. _Documentation: http://circuits.readthedocs.org/en/latest/\n.. _Downloads: https://github.com/circuits/circuits/releases\n.. _Ask a Question: http://stackoverflow.com/questions/ask\n.. _Stackoverflow: http://stackoverflow.com/\n\n.. image:: https://github.com/circuits/circuits/actions/workflows/python-app.yml/badge.svg\n   :target: https://github.com/circuits/circuits/actions/workflows/python-app.yml\n   :alt: Build Status\n\n.. image:: https://codecov.io/gh/circuits/circuits/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/circuits/circuits\n  :alt: Coverage\n\ncircuits is a **Lightweight** **Event** driven and **Asynchronous**\n**Application Framework** for the `Python Programming Language`_\nwith a strong **Component** Architecture.\n\ncircuits also includes a lightweight, high performance and scalable\nHTTP/WSGI compliant web server as well as various I/O and Networking\ncomponents.\n\n- `Website`_\n- `Downloads`_\n- `Documentation`_\n\nGot questions?\n\n- `Ask a Question`_ (Tag it: ``circuits-framework``)\n\n\nExamples\n--------\n\nHello\n.....\n\n\n.. code:: python\n\n    #!/usr/bin/env python\n\n    \"\"\"circuits Hello World\"\"\"\n\n    from circuits import Component, Event\n\n\n    class hello(Event):\n        \"\"\"hello Event\"\"\"\n\n\n    class App(Component):\n\n        def hello(self):\n            \"\"\"Hello Event Handler\"\"\"\n\n            print(\"Hello World!\")\n\n        def started(self, component):\n            \"\"\"Started Event Handler\n\n            This is fired internally when your application starts up and can be used to\n            trigger events that only occur once during startup.\n            \"\"\"\n\n            self.fire(hello())  # Fire hello Event\n\n            raise SystemExit(0)  # Terminate the Application\n\n    App().run()\n\n\nEcho Server\n...........\n\n\n.. code:: python\n\n    #!/usr/bin/env python\n\n    \"\"\"Simple TCP Echo Server\n\n    This example shows how you can create a simple TCP Server (an Echo Service)\n    utilizing the builtin Socket Components that the circuits library ships with.\n    \"\"\"\n\n    from circuits import handler, Debugger\n    from circuits.net.sockets import TCPServer\n\n\n    class EchoServer(TCPServer):\n\n        @handler(\"read\")\n        def on_read(self, sock, data):\n            \"\"\"Read Event Handler\n\n            This is fired by the underlying Socket Component when there has been\n            new data read from the connected client.\n\n            ..note :: By simply returning, client/server socket components listen\n                      to ValueChagned events (feedback) to determine if a handler\n                      returned some data and fires a subsequent Write event with\n                      the value returned.\n            \"\"\"\n\n            return data\n\n    # Start and \"run\" the system.\n    # Bind to port 0.0.0.0:8000\n    app = EchoServer(8000)\n    Debugger().register(app)\n    app.run()\n\n\nHello Web\n.........\n\n\n.. code:: python\n\n    #!/usr/bin/env python\n\n    from circuits.web import Server, Controller\n\n\n    class Root(Controller):\n\n        def index(self):\n            \"\"\"Index Request Handler\n\n            Controller(s) expose implicitly methods as request handlers.\n            Request Handlers can still be customized by using the ``@expose``\n            decorator. For example exposing as a different path.\n            \"\"\"\n\n            return \"Hello World!\"\n\n    app = Server((\"0.0.0.0\", 8000))\n    Root().register(app)\n    app.run()\n\n\nMore `examples <https://github.com/circuits/circuits/tree/master/examples>`_...\n\n\n\nFeatures\n--------\n\n- event driven\n- concurrency support\n- component architecture\n- asynchronous I/O components\n- no required external dependencies\n- full featured web framework (circuits.web)\n- coroutine based synchronization primitives\n\n\nRequirements\n------------\n\n- circuits has no dependencies beyond the `Python Standard Library`_.\n\n\nSupported Platforms\n-------------------\n\n- Linux, FreeBSD, Mac OS X, Windows\n- Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12\n- pypy (the newer the better)\n\n\nInstallation\n------------\n\nThe simplest and recommended way to install circuits is with pip.\nYou may install the latest stable release from PyPI with pip::\n\n    $ pip install circuits\n\nIf you do not have pip, you may use easy_install::\n\n    $ easy_install circuits\n\nAlternatively, you may download the source package from the\n`PyPi`_ or the `Downloads`_ extract it and install using::\n\n    $ python setup.py install\n\n\n.. note::\n    You can install the `development version\n    <https://github.com/circuits/circuits/archive/master.zip#egg=circuits-dev>`_\n    via ``pip install circuits==dev``.\n\n\nLicense\n-------\n\ncircuits is licensed under the `MIT License`_.\n\n\nFeedback\n--------\n\nWe welcome any questions or feedback about bugs and suggestions on how to\nimprove circuits.\n\nLet us know what you think about circuits. `@pythoncircuits <http://twitter.com/pythoncircuits>`_.\n\nDo you have suggestions for improvement? Then please `Create an Issue`_\nwith details of what you would like to see. I'll take a look at it and\nwork with you to either incorporate the idea or find a better solution.\n\n\nCommunity\n---------\n\nThere are also several places you can reach out to the circuits community:\n\n- `Mailing List`_\n- `#circuits IRC Channel`_ on the `Libera.Chat IRC Network`_\n- `Ask a Question`_ on `Stackoverflow`_ (Tag it: ``circuits-framework``)\n\n----\n\nDisclaimer\n----------\n\nWhilst I (James Mills) continue to contribute and maintain the circuits project\nI do not represent the interests or business of my employer Facebook Inc. The\ncontributions I make are of my own free time and have no bearing or relevance\nto Facebook Inc.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Asynchronous Component based Event Application Framework",
    "version": "3.2.3",
    "project_urls": {
        "Download": "http://bitbucket.org/circuits/circuits/downloads/",
        "Homepage": "http://circuitsframework.com/"
    },
    "split_keywords": [
        "event",
        "framework",
        "distributed",
        "concurrent",
        "component",
        "asynchronous"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "94fa2bb047778e87cd1c517cd6b7b4b9e8ccfbe6fa04146c157b712dc6f92c33",
                "md5": "8a91ac9258e8925c7815b24c271556fc",
                "sha256": "47c5fc17aef3628dc8271b000332a337db29d040aa828107b2054c2b637c4f9e"
            },
            "downloads": -1,
            "filename": "circuits-3.2.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8a91ac9258e8925c7815b24c271556fc",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.7",
            "size": 163658,
            "upload_time": "2024-04-03T22:50:19",
            "upload_time_iso_8601": "2024-04-03T22:50:19.046200Z",
            "url": "https://files.pythonhosted.org/packages/94/fa/2bb047778e87cd1c517cd6b7b4b9e8ccfbe6fa04146c157b712dc6f92c33/circuits-3.2.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-03 22:50:19",
    "github": false,
    "gitlab": false,
    "bitbucket": true,
    "codeberg": false,
    "bitbucket_user": "circuits",
    "bitbucket_project": "circuits",
    "lcname": "circuits"
}
        
Elapsed time: 3.85633s