Package: pycom
PyCOM is simple and easy-to-use distributed component model written in Python.
PyCOM makes different parts of your network application isolated and
independent, while allowing easy and straightforward interaction between them.
PyCOM may be seen as an easy and lightweight web services replacement.Ideology highlights:Non-intrusive design without black magic and lots of auto-generated codeEasily adapts to a rapidly changing environment… and matches pythonicEAFPapproachEffective, easy-to-implement and portable protocolSupport for binary attachmentsSupport for stateful services via HTTP-alike sessionsLow level enough to build your own frameworks… and still simple enough to be used as isFree software (new BSD license)Technical highlights:Separate (potentially replaceable)ZeroJSONprotocol implementationEasily extensible core libraryDoes not required special “container” softwareIntrospection support for servicesLoad balancing over several services with the same interfaceComprehensive test suite and documentationPython 2 and Python 3 support out-of-boxThere is ongoing effort to create a C++ client library for PyCOM:https://bitbucket.org/divius/libpycomMain conceptsWith PyCOM you build your application as a number ofservices,
each running in it’s own process (or even on it’s own computer).
You maintain a PyCOMnameserverfor finding services by their names
(by the way, nameserver itself is a service).Services provideinterfaces, i.e. a named way of interacting with service.
They are somewhat similar to interfaces in e.g. Java, but note that
PyCOM does not perform any checks on interfaces. Interface usually has
some amount ofmethods.Services are identified by path with parts separated by slashes,
e.g./com/foo/group/service.Interfaces are identified by name with parts separated by dots,
e.g.com.foo.my-interface.ExamplesService example (modulepackage1.module1):import pycom

@pycom.interface("com.foo.example")
class MyService(pycom.Service):

    @pycom.method
    def bar(self, request, name, value=None):
        return {name : value}Example command line for running this service (provided nameserver is running
on192.168.10.1:2012):python -m pycom -a tcp://192.168.10.2:2013 -n tcp://192.168.10.1:2012 package1.module1Example client code for this service:import pycom

context = pycom.ProxyContext(nameserver="tcp://192.168.10.1:2012")
with context.locate("com.foo.example") as component:
    print component.bar(name="field1", value=42)
    # Prints {"field1" : 42}
    print component.bar("field1", value=42)
    # Prints {"field1" : 42}
    print component.bar("field1")
    # Prints {"field1" : None}
    print component.introspect()
    # Prints a lot of introspection informationQuick startOur requirements are:POSIX-compatible OS (other may work)Python2.6, 2.7 or >= 3.10MQ Python bindings>= 2.1.11sixfor Python 3 compatibility
(maybe we’ll drop it later)To run test suite you’ll also need:coverage.pyunittest2(Python 2.6 only)unittest2py3k(Python 3.1 only)To test (logs will be saved intest.log):$ python test.pyTo build HTML documentation (requiresSphinx):$ python setup.py build_sphinx
$ <your-browser> build/sphinx/html/index.htmlTo install from sources:$ python setup.py installor viapip:$ pip install pycomTo start nameserver use script:$ /usr/local/bin/pycom-nameserverYou may need to adjust nameserver configuration.Do not forget to read about known issues in the current version:http://packages.python.org/pycom/status.html#known-issuesSupportPyCOM repository and issue tracker are hosted on BitBucket.Download releases:http://pypi.python.org/pypi/pycom#downloadsLatest source code:https://bitbucket.org/divius/pycom/overviewReport bugs:https://bitbucket.org/divius/pycom/issuesRead documentation:http://www.pycom.orgEnjoy =)