{ "info": { "author": "Dieter Maurer", "author_email": "dieter@handshake.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Zope2", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.4", "Programming Language :: Python :: 2.6", "Topic :: Utilities" ], "description": "This package implements a middleware\nwhich allows to provide an internet\nservice (a set of functions made available via the internet)\nover multiple rpc protocols with a common (protocol independent) service\nimplementation.\n\nThe service functions can be called both via \"GET\" as well as\n\"POST\" requests. \"GET\" requests are supported to leverage HTTP caching and to\nfacilitate debugging. To get the types right, \"GET\" requests must use the\n``ZPublisher`` type conversion support (or some \"GET\" support\ndefined by the rpc protocol itself (as e.g. by the json-rpc protocol)).\n\nThe rpc protocol can be selected via url components (other means\nare implementable as well but not directly supported). Available protocols\nare selectable via deployment configuration.\n\nThis package supports the protocols\n\n ``reprrpc`` \n a result format based on Python's repr -- mainly for testing purposes,\n\n ``jsonrpc``\n a ``json`` based rpc protocol, defined by http://json-rpc.org/.\n\n This requires the ``json`` module of Python 2.6 (separately installed,\n if necessary)\n\n ``xmlrpc``\n the rpc protocol based on Python's ``xmlrpc`` module.\n\n This requires the PyPI package ``dm.reuse`` and\n (probably) ``dm.zopepatches.xmlrpc`` (to control/deactivate\n Zope's builtin xmlrpc support).\n\nForthcoming subpackages will support ``soap`` based protocols for\nservices described by WSDL.\n\n\nArchitecture\n============\n\nAt the package's core is a protocol handler. Its task is to handle\nincoming requests for a specific rpc protocol. To prepare for the\nprotocol specific serialization of the result, it installs a new\nresponse object. This will handle the result and potential exceptions\nin a protocol specific way. In addition, the handler parses a potential\nrequest body and updates the ``ZPublisher`` argument information\naccordingly. Thereafter, \"GET\" and \"POST\" requests are (almost) identical.\n\nUsually, the protocol handlers for the various protocols are\nregistered in a Zope Toolkit ``namespace``. Protocol selection\nthen can use an url component of the form\n``++``\\ *namespace*\\ ``++``\\ *protocol*.\n\nThe protocol handlers in this package derive from a generic\n(protocol and configuration independent) class and delegate protocol \nand configuration specific operations to a protocol specific mashaller,\nwhich also holds the configuration. The marshaller is either\nspecified via the handler's ``marshaller`` attribute or obtained\nby adaptation of the handler to the ``.interfaces.IMarshaller`` interface.\nThe function ``.handler.handlerfactory_from_marshaller`` facilitates\nthe definition of a handler factory which then can be used in the\ndefinition of an adapter.\nAs a consequence, a specially configured protocol handler\nis usually set up by instantiating an appropriately configured\nmarshaller, passing this marshaller to ``handlerfactory_from_marshaller``\nand registering the resulting protocol handler factory as\nan adapter (for context and request).\n\nThe rpc protocols usually support only a limited set of types.\nThe potentially richer type world used by the service results need\nto be mapped to the restricted type set. In addition, the types\ndelivered by the protocol modules' deserialization differ. Using\na standardized set of types toward the service\nfacilitates its implementation.\nTherefore, the architecture contains an ``IDataAdapter`` component.\nIt has two methods ``normalize_in`` and ``normalize_out`` to normalize\nthe types used in incoming or outgoing values, respectively.\nThe marshallers look it up via adaptation to ``.interfaces.IDataAdapter``.\nThe implemented marshallers derive from ``.adapter.StandardDataAdapter``.\nIt normalizes incoming types to ``bool``, ``int``, ``float``, ``binary``,\na text type (either ``str`` or ``unicode``), a date type\n(either ``datetime.date`` or Zope's ``DateTime.DateTime``),\na datetime type (either ``datetime.datetime`` or Zope's ``DateTime.DateTime``)\nand lists and structure wrappers of normalized types.\nThe structure wrappers support both the mapping api as well as\nattribute access; they can be read and written by untrusted code.\nOptions control which text, date and datetime types are used (see below).\nOutgoing types are normalized to ``bool``, ``int``, ``float``, ``binary``,\n``unicode``, ``date``, ``datetime`` and lists/dictionaries of normalized\nvalues. Instance objects with an ``items`` method are normalized\nto the dicts of (normalized) items; instance objects with an ``__iter__``\nmethod are normalized as the list of (normalized) iterated values;\nother instance objects are normalized by normalizing their\n``__dict__`` omitting attributes starting with ``_`` (priviate\nattributes), an ``_rpc_type`` attribute may be added to convey\nthe original type. This has the drawback that default (class level\ndefined) attributes are not taken into account.\nYou can find details about the standard data adapter in \n``adapter.txt`` in the subdirectory ``tests``.\n\nText handling is difficult with rpc protocols.\nWith Python 2.x, ``str`` is still often used to represent both text\nand binary data while many rpc protocols make a strict distinction\nbetween text and binary data. Therefore, the package defines\na special type ``binary`` to clearly mark binary data.\n``binary`` is derived from ``str`` and can (usually) be used whereever ``str``\nis usable (there are a few exceptions).\nAn option for the standard data adapter specifies whether\nthe service uses ``str`` to represent text. In this case, the\nprotocol text type is mapped to ``str`` (and vice versa) using an encoding\nspecified via an additional option.\nSome rpc protocols (e.g. ``json``) do not support a binary type. In this\ncase, the module assumes that binary data is coded by the first 256 unicode\ncodepoints. The ``binary`` type implements this assumption.\n\nIn the Zope [2] world, dates and datetimes pose another ambiguitiy.\nTraditionally, Zope uses its ``DateTime.DateTime`` class to represent\ndates and datetimes. But newer applications may have switched to Python's\nnew ``date`` and ``datetime`` types. The standard data adapter uses\nPython's types to represent dates and times externally (toward the\nprotocol) and has an option whether it should convert them to\nZope's ``DateTime`` internally (toward the service implementation).\n\n\nExamples\n========\n\nYou can find simple examples in ``tests.example`` and ``tests.xmlrpc``.\n``example`` demonstrates example zcml registrations to support\n``jsonrpc`` and ``reprrpc``, ``xmlrpc`` does so for the ``xmlrpc`` protocol.\n\nThe package uses (mostly) the Zope Toolkit component architecture\nto combine the various architectural components and\nintegrate the package into an application. This provides for great\nflexibility. Individual components can be easily replaced by\napplication specific adaptations. Up to now, there are no\ndocumentation or specific examples. You will need to look at\nthe component sources to find out the possibilities.\n\nInstallation\n============\n\nThe package expects to be used inside a Zope [2] environment.\nHowever, to facilitate use in a Zope below version 2.12 (the first eggified\nZope 2 version), it does not specify this dependency.\n\nIn a Zope below 2.12, it might be necessary to set up some\nso called ``fake-eggs`` (supported by the buildout recipe\n``plone.recipe.plone2instance``) or egg links, e.g. for ``zope.schema``,\nand ``zope.interface``, such that these eggs are found inside the\nZope codetree.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/dm.zope.rpc", "keywords": "rpc zope multiprotocol", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "dm.zope.rpc", "package_url": "https://pypi.org/project/dm.zope.rpc/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dm.zope.rpc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/dm.zope.rpc" }, "release_url": "https://pypi.org/project/dm.zope.rpc/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Remote Procedure Call server support for Zope[2]", "version": "1.0.1" }, "last_serial": 791265, "releases": { "0.1a1": [ { "comment_text": "", "digests": { "md5": "c5cd5db18bd4b73d324b8927cbdb8d60", "sha256": "4399fe29ead0e37930d4b5848e1cb2f46dcb8c2bf602c258c0918c80b92f275b" }, "downloads": -1, "filename": "dm.zope.rpc-0.1a1.tar.gz", "has_sig": false, "md5_digest": "c5cd5db18bd4b73d324b8927cbdb8d60", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21685, "upload_time": "2010-09-04T10:33:55", "url": "https://files.pythonhosted.org/packages/67/59/5b8f3d53843f83d427101a0f92fe991e16262c408824f3b73fa805fa3dca/dm.zope.rpc-0.1a1.tar.gz" } ], "0.1a2": [ { "comment_text": "", "digests": { "md5": "7b4a41322d5ca99cae379391fd7b7646", "sha256": "1bd569ffd762cc1d9dfceeddda816a62a432fb8b3100b005e1ba6272b0de1d58" }, "downloads": -1, "filename": "dm.zope.rpc-0.1a2.tar.gz", "has_sig": false, "md5_digest": "7b4a41322d5ca99cae379391fd7b7646", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22039, "upload_time": "2010-09-11T17:39:56", "url": "https://files.pythonhosted.org/packages/6b/6f/39f3b21ecdc62d9887d47ee87e1c69b12a1671bf407144535af1bdaa7544/dm.zope.rpc-0.1a2.tar.gz" } ], "0.2a1": [ { "comment_text": "", "digests": { "md5": "c9b43a85faa56b3a139dc29a5d962e05", "sha256": "2e5eea76e720a6190be2019fd643fca6a6d30d5f4158893eec2e71f6f26188bd" }, "downloads": -1, "filename": "dm.zope.rpc-0.2a1.tar.gz", "has_sig": false, "md5_digest": "c9b43a85faa56b3a139dc29a5d962e05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21824, "upload_time": "2010-09-12T09:50:38", "url": "https://files.pythonhosted.org/packages/1b/1a/ac1efd0c300ff89f6f7cfe1150615c8b2a7bc9e75278afe51e80e69edbfd/dm.zope.rpc-0.2a1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "944cda41e2c427012c89e7810b85537f", "sha256": "309b53a6a3c095c4417ff744c6211aca35e362cd4a2ef8d799fbffe94148e51c" }, "downloads": -1, "filename": "dm.zope.rpc-1.0.tar.gz", "has_sig": false, "md5_digest": "944cda41e2c427012c89e7810b85537f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22338, "upload_time": "2012-09-13T09:20:40", "url": "https://files.pythonhosted.org/packages/d7/d7/0101e1e3fda44beda35b8bd947ea0647e834e1950c773fc1636f23523b38/dm.zope.rpc-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "87c16a1ddf544f9557de5b76b0dfe9d4", "sha256": "c072c654c2064dd7c7d00782ccb8807a43f2a588597d0106c573e060d618d95a" }, "downloads": -1, "filename": "dm.zope.rpc-1.0.1.tar.gz", "has_sig": false, "md5_digest": "87c16a1ddf544f9557de5b76b0dfe9d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22342, "upload_time": "2013-03-20T08:27:27", "url": "https://files.pythonhosted.org/packages/ae/52/538b7b441f1485350bc8300842d3d1a846ae605589b04dcc9ea79433e998/dm.zope.rpc-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "87c16a1ddf544f9557de5b76b0dfe9d4", "sha256": "c072c654c2064dd7c7d00782ccb8807a43f2a588597d0106c573e060d618d95a" }, "downloads": -1, "filename": "dm.zope.rpc-1.0.1.tar.gz", "has_sig": false, "md5_digest": "87c16a1ddf544f9557de5b76b0dfe9d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22342, "upload_time": "2013-03-20T08:27:27", "url": "https://files.pythonhosted.org/packages/ae/52/538b7b441f1485350bc8300842d3d1a846ae605589b04dcc9ea79433e998/dm.zope.rpc-1.0.1.tar.gz" } ] }