Skip to main content

A Python application framework and CLI tool to build and manage async event pipeline servers with minimal effort, forked from the wishbone project

Project description

Compysition
========

What?
-----

The **compysition** project is built upon the original work of the Wishbone_ project, which is described as follows:
::

A Python application framework and CLI tool build and manage async event
pipeline servers with minimal effort.


We have created **compysition** to build off the simple way in which Wishbone_ managed message flow across multiple
modules. Compysition also expands upon this module registration module to provide abstracted multi-process communication
via 0mq_, as well as the ability for full cyclical communication for in-process request/response behavior in a lightweight,
fast, and fully concurrent manner

.. _0mq: http://zeromq.org/
.. _Wishbone: https://github.com/smetj/wishbone

**Compysition is currently new and in pre-Beta release. It will be undergoing many deep changes in the coming months**

Full Circle WSGI Example
-------

For the example below, we want to execute an XML transformation on a request and send it back to the client in a fast
and concurrent way. All steps and executions are spun up as spawned greenlet on the router

.. image:: docs/examples/full_circle_wsgi_example.jpg
:align: center

.. code-block:: python

from compysition.router import Default
from compysition.module import WSGI
from compysition.module import BasicAuth
from compysition.module import Transformer
from compysition.module import Funnel

from mymodules.module import SomeRequestExecutor

router = Default()
router.register(WSGIServer, "wsgi")
router.register(BasicAuth, "auth")
router.register(Funnel, "wsgi_collector")
router.register(Transformer, "submit_transform", 'SourceOne/xsls/submit.xsl')
router.register(Transformer, "acknowledge_transform", 'SourceOne/xsls/acknowledge.xsl', 'XML', 'submit_transform') # *args are the subjects of transform
router.register(SomeRequestExecutor, "request_executor")

router.connect('wsgi.outbox', 'auth.inbox')
router.connect('wsgi_collector.outbox', 'wsgi.inbox') # This collects messages from multiple sources and directs them to wsgi.inbox
router.connect('auth.outbox', 'submit_transform.inbox')
router.connect('auth.errors', 'wsgi_collector.auth_errors') # Redirect auth errors to the wsgi server as a 401 Unaothorized Error
router.connect('submit_transform.outbox', 'request_executor.inbox')
router.connect('submit_transform.errors', 'wsgi_collector.transformation_errors')
router.connect('request_executor.outbox', 'acknowledge_transform.inbox')
router.connect('acknowledge_transform.outbox', 'wsgi_collector.inbox')

router.start()
router.block()

Note how modular each component is. It allows us to configure any steps in between class method executions and add
any additional executions, authorizations, or transformations in between the request and response by simply
adding it into the message execution flow

One-way messaging example
-------

.. image:: docs/intro.png
:align: center

.. code-block:: python

from compysition.router import Default
from compysition.module import TestEvent
from compysition.module import RoundRobin
from compysition.module import STDOUT

router=Default()
router.register(TestEvent, "input")
router.register(RoundRobin, "mixing")
router.register(STDOUT, "output1", prefix="I am number one: ")
router.register(STDOUT, "output2", prefix="I am number two: ")

router.connect("input.outbox", "mixing.inbox")
router.connect("mixing.one", "output1.inbox")
router.connect("mixing.two", "output2.inbox")

router.start()
router.block()

Output:
I am number one: test
I am number two: test
I am number one: test
I am number two: test
I am number one: test
I am number two: test
I am number one: test
I am number two: test
I am number one: test
I am number two: test


Installing
----------

Through Pypi:

$ easy_install compysition

Or the latest development branch from Github:

$ git clone git@github.com:fiebiga/compysition.git

$ cd compysition

$ sudo python setup.py install


Original Wishbone Project: Documentation
-------------

https://wishbone.readthedocs.org/en/latest/index.html


Other Available Modules <Original Wishbone Project>
-------

https://github.com/smetj/wishboneModules

Support
-------

You may email myself at fiebig.adam@gmail.com

Project details


Release history Release notifications

History Node

1.2.54

History Node

1.2.53

History Node

1.2.52

History Node

1.2.51

History Node

1.2.50

History Node

1.2.49

History Node

1.2.48

History Node

1.2.47

History Node

1.2.46

History Node

1.2.45

History Node

1.2.44

History Node

1.2.43

History Node

1.2.42

History Node

1.2.41

History Node

1.2.4

History Node

1.2.3

History Node

1.2.2

History Node

1.2.1

History Node

1.2.0

History Node

1.1.42

History Node

1.1.41

History Node

1.1.40

History Node

1.1.39

History Node

1.1.38

History Node

1.1.37

History Node

1.1.36

History Node

1.1.35

History Node

1.1.34

History Node

1.1.33

History Node

1.1.32

History Node

1.1.30

History Node

1.1.29

History Node

1.1.28

History Node

1.1.27

History Node

1.1.26

History Node

1.1.25

History Node

1.1.24

History Node

1.1.23

History Node

1.1.22

History Node

1.1.21

History Node

1.1.20

History Node

1.1.19

History Node

1.1.18

History Node

1.1.17

History Node

1.1.16

History Node

1.1.15

History Node

1.1.13

History Node

1.1.11

History Node

1.1.10

History Node

1.1.09

History Node

1.1.08

History Node

1.1.07

History Node

1.1.06

History Node

1.1.05

History Node

1.1.04

History Node

1.1.03

History Node

1.1.02

History Node

1.1.01-dev

History Node

1.0.66

History Node

1.0.65

History Node

1.0.64

History Node

1.0.63

History Node

1.0.62

History Node

1.0.61

History Node

1.0.58

History Node

1.0.57

History Node

1.0.56

History Node

1.0.55

History Node

1.0.54

History Node

1.0.53

History Node

1.0.52

History Node

1.0.51

History Node

1.0.5

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.0.7

History Node

0.0.6

This version
History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
compysition-0.0.5.tar.gz (40.4 kB) Copy SHA256 hash SHA256 Source None Aug 26, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page