Giter Club home page Giter Club logo

suds-lxml's Introduction

Overview

https://travis-ci.org/liboz/suds-lxml.svg?branch=master https://coveralls.io/repos/github/liboz/suds-lxml/badge.svg?branch=master

Based on the original 'suds' project by Jeff Ortel (jortel at redhat dot com) hosted at 'http://fedorahosted.org/suds' and 'suds-jurko' by Jurko Gospodnetić ( [email protected] ) hosted at https://bitbucket.org/jurko/suds.

"Suds" is a lightweight SOAP-based web service client for Python licensed under LGPL (see the LICENSE.txt file included in the distribution).

One major problem with suds is that it is slow. This is a fork of suds that tries to solve it by parse the xml returned with the fast lxml parser instead of the default suds implementation. It requires lxml to be installed.

I was initially inspired by http://stackoverflow.com/questions/22171100/python2-sax-parser-best-speed-and-performance-for-large-files.

Forked project information

Original suds Python library development project information

Installation

Standard Python installation.

Here are the basic instructions for 3 different installation methods:

  1. Using pip
    • Have the pip package installed.
    • Run pip install suds-lxml.
  2. Using easy-install
    • Have the setuptools package installed.
    • Run easy_install suds-lxml.
  3. From sources
    • Unpack the source package somewhere.
    • Run python setup.py install from the source distribution's top level folder.

Usage

I attempt to give the same APIs to call webservices as the original suds, the only difference is what the calls themselves do. The python objects that are created are not the standard suds objects either and are just a simple dict like object.

Simple:

from suds.lxmlclient import Client
c = Client('https://www.yourwsdl.com?wsdl')

To Access to the original client:

from suds.lxmlclient import Client
c = Client('https://www.yourwsdl.com?wsdl')
original_client = c.suds_client

To convert the returned SoapObject to a dictionary (note that this isn't recursive):

from suds.lxmlclient import Client
c = Client('https://www.yourwsdl.com?wsdl')
result = c.service.test()
result.as_dict()

To accessing a property on a SoapObject:

from suds.lxmlclient import Client
c = Client('https://www.yourwsdl.com?wsdl')
result = c.service.test()
success = result.success

Benchmarks

This project was started because I had to deal with large SOAP return envelopes and I wanted to use suds. However, suds was simply too slow.

Here are some initial benchmarks for just the parsing on a 30 MB return envelope. We take the average over 10 iterations:

``suds-jurko baseline:` 18.1 seconds for deserialize/to_python`

suds-lxml: 0.115s for lxml deserialize, 4.09s for to_python

Or about 4 times faster.

suds-lxml's People

Contributors

apkawa avatar bouke avatar grzn avatar jurko-gospodnetic avatar liboz avatar mduggan avatar palday avatar timsavage avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.