flask-spyne-py3


Nameflask-spyne-py3 JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryA Flask extension, provides support for Spyne.
upload_time2024-05-17 18:30:05
maintainerNone
docs_urlNone
authorAlejo Sarmiento
requires_pythonNone
licenseCC0 1.0
keywords flask spyne soap wsdl wsgi zeromq rest rpc json http msgpack xml werkzeug yaml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Flask-Spyne
===========

Flask-Spyne is a `Flask <http://flask.pocoo.org>`_ extension which
provides `Spyne <http://spyne.io>`_ (formerly known as 
`soaplib <http://soaplib.github.io/soaplib/2_0/>`_) support. 
Includes SOAP, WSDL, JSON, XML, YAML and other transports and protocols.
Inspired by unofficial 
`Flask-Enterprise <http://massive.immersedcode.org/2011/staging/projects/default/python/flask-enterprise/>`_
extension (a wrapper on top of outdated `soaplib <http://soaplib.github.io/soaplib/2_0/>`_).

* `PyPI listing <http://pypi.python.org/pypi/Flask-Spyne>`_

Installation
------------
::

    pip install flask-spyne

Please check `list of additional requirements <http://spyne.io/docs/2.11/#requirements>`_
you might need to install.

Server example
--------------

.. code-block:: python

  from flask import Flask
  from flask_spyne import Spyne
  from spyne.protocol.soap import Soap11
  from spyne.model.primitive import Unicode, Integer
  from spyne.model.complex import Iterable
  
  app = Flask(__name__)
  spyne = Spyne(app)
  
  class SomeSoapService(spyne.Service):
      __service_url_path__ = '/soap/someservice'
      __in_protocol__ = Soap11(validator='lxml')
      __out_protocol__ = Soap11()
      
      @spyne.srpc(Unicode, Integer, _returns=Iterable(Unicode))
      def echo(str, cnt):
          for i in range(cnt):
              yield str
  
  if __name__ == '__main__':
      app.run(host = '127.0.0.1')

Client example
--------------

.. code-block:: python

  from suds.client import Client as SudsClient

  url = 'http://127.0.0.1:5000/soap/someservice?wsdl'
  client = SudsClient(url=url, cache=None)
  r = client.service.echo(str='hello world', cnt=3)
  print r

WS-Security
-----------

Starting from v0.2 flask-spyne supports basics of WS-Security for SOAP services.

Specify __wsse_conf__ dict with following fields::

    username (str, required)
    password (str, required)
    password-digest (bool, optional)
    nonce-freshness-time (int, optional)
    reject-empty-nonce-creation (bool, optional)
    reject-stale-tokens (bool, optional)
    reject-expiry-limit (int, optional)

See server_auth.py/client_auth.py in ``examples`` for more details.

Written by Robert Ayrapetyan (robert.ayrapetyan@gmail.com).

No copyright. This work is dedicated to the public domain.
For full details, see https://creativecommons.org/publicdomain/zero/1.0/

The third-party libraries have their own licenses, as detailed in their source files.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "flask-spyne-py3",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "flask, spyne, soap, wsdl, wsgi, zeromq, rest, rpc, json, http, msgpack, xml, werkzeug, yaml",
    "author": "Alejo Sarmiento",
    "author_email": "asarmiento@leafnoise.io",
    "download_url": "https://files.pythonhosted.org/packages/37/f8/8f62ab451cb0d3480ba99e1819c919a7ceeaa12737c8477043cb1b85f86e/flask-spyne-py3-1.0.0.tar.gz",
    "platform": "any",
    "description": "Flask-Spyne\n===========\n\nFlask-Spyne is a `Flask <http://flask.pocoo.org>`_ extension which\nprovides `Spyne <http://spyne.io>`_ (formerly known as \n`soaplib <http://soaplib.github.io/soaplib/2_0/>`_) support. \nIncludes SOAP, WSDL, JSON, XML, YAML and other transports and protocols.\nInspired by unofficial \n`Flask-Enterprise <http://massive.immersedcode.org/2011/staging/projects/default/python/flask-enterprise/>`_\nextension (a wrapper on top of outdated `soaplib <http://soaplib.github.io/soaplib/2_0/>`_).\n\n* `PyPI listing <http://pypi.python.org/pypi/Flask-Spyne>`_\n\nInstallation\n------------\n::\n\n    pip install flask-spyne\n\nPlease check `list of additional requirements <http://spyne.io/docs/2.11/#requirements>`_\nyou might need to install.\n\nServer example\n--------------\n\n.. code-block:: python\n\n  from flask import Flask\n  from flask_spyne import Spyne\n  from spyne.protocol.soap import Soap11\n  from spyne.model.primitive import Unicode, Integer\n  from spyne.model.complex import Iterable\n  \n  app = Flask(__name__)\n  spyne = Spyne(app)\n  \n  class SomeSoapService(spyne.Service):\n      __service_url_path__ = '/soap/someservice'\n      __in_protocol__ = Soap11(validator='lxml')\n      __out_protocol__ = Soap11()\n      \n      @spyne.srpc(Unicode, Integer, _returns=Iterable(Unicode))\n      def echo(str, cnt):\n          for i in range(cnt):\n              yield str\n  \n  if __name__ == '__main__':\n      app.run(host = '127.0.0.1')\n\nClient example\n--------------\n\n.. code-block:: python\n\n  from suds.client import Client as SudsClient\n\n  url = 'http://127.0.0.1:5000/soap/someservice?wsdl'\n  client = SudsClient(url=url, cache=None)\n  r = client.service.echo(str='hello world', cnt=3)\n  print r\n\nWS-Security\n-----------\n\nStarting from v0.2 flask-spyne supports basics of WS-Security for SOAP services.\n\nSpecify __wsse_conf__ dict with following fields::\n\n    username (str, required)\n    password (str, required)\n    password-digest (bool, optional)\n    nonce-freshness-time (int, optional)\n    reject-empty-nonce-creation (bool, optional)\n    reject-stale-tokens (bool, optional)\n    reject-expiry-limit (int, optional)\n\nSee server_auth.py/client_auth.py in ``examples`` for more details.\n\nWritten by Robert Ayrapetyan (robert.ayrapetyan@gmail.com).\n\nNo copyright. This work is dedicated to the public domain.\nFor full details, see https://creativecommons.org/publicdomain/zero/1.0/\n\nThe third-party libraries have their own licenses, as detailed in their source files.\n",
    "bugtrack_url": null,
    "license": "CC0 1.0",
    "summary": "A Flask extension, provides support for Spyne.",
    "version": "1.0.0",
    "project_urls": {
        "Download": "http://pypi.python.org/pypi/flask-spyne-py3"
    },
    "split_keywords": [
        "flask",
        " spyne",
        " soap",
        " wsdl",
        " wsgi",
        " zeromq",
        " rest",
        " rpc",
        " json",
        " http",
        " msgpack",
        " xml",
        " werkzeug",
        " yaml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eb07197b15d71039afabb8caed731527976f7c47b24aeee0ad6d1bd72ed1daa6",
                "md5": "a97e17d25940f22ab9d9817aa62047f2",
                "sha256": "a7e701943bf007c6766f5d073f946a4e722be24ab94cb2577aa4d0254be93d81"
            },
            "downloads": -1,
            "filename": "flask_spyne_py3-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a97e17d25940f22ab9d9817aa62047f2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4246,
            "upload_time": "2024-05-17T18:30:03",
            "upload_time_iso_8601": "2024-05-17T18:30:03.363538Z",
            "url": "https://files.pythonhosted.org/packages/eb/07/197b15d71039afabb8caed731527976f7c47b24aeee0ad6d1bd72ed1daa6/flask_spyne_py3-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "37f88f62ab451cb0d3480ba99e1819c919a7ceeaa12737c8477043cb1b85f86e",
                "md5": "76b329927f01010d0e308feeff00951a",
                "sha256": "a03a42243c2e0c286ac6370e207911bbf747671385ad02559d717d08608314e5"
            },
            "downloads": -1,
            "filename": "flask-spyne-py3-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "76b329927f01010d0e308feeff00951a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4165,
            "upload_time": "2024-05-17T18:30:05",
            "upload_time_iso_8601": "2024-05-17T18:30:05.574105Z",
            "url": "https://files.pythonhosted.org/packages/37/f8/8f62ab451cb0d3480ba99e1819c919a7ceeaa12737c8477043cb1b85f86e/flask-spyne-py3-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-17 18:30:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "flask-spyne-py3"
}
        
Elapsed time: 0.25593s