webservices in python - python

i want to create a webservice (SOAP & REST) in python which cab be called from iphone,
now i have install python 2.7.1 on Ubuntu 10.04.2 LTS using Putty. so now i am searching for a nice and easy framework that helps me in creating webservices and web programming.
I have searched a lot but confused with the combination of framworks.

Duplicate of
Python soap using soaplib (server) and suds (client)
Suds/soaplib is fine for working wit SOAP client/server side.
REST is a different story. I think you should first choose one of the many Python web-frameworks.
"Pyramid" - part of the Pylons projects - is a very strong but open-to-all-sides webframework which could be used for both SOAP and REST-ish services.
http://docs.pylonsproject.org/

For REST, I am very satisfied with Flask.

Related

Django 1.10 & Socket.IO with Python 3

I'm trying to find some "django-socketio" repo to use in my project. I using django 1.10 and python3. I really searched but I do not found working examples with python3.
My poor workaround
I started node project and put socket.io inside route
In my django view I send returning data to node route with my django session
I manage session coming from django inside my node and emit inside
route to client.
This work but I can't believe this is a good solution.. Anyone have other ideas? Or working examples with python3 and socketio?
Thanks!
If you want to use Websockets and Django you should consider https://github.com/django/channels. The alternative in Python would be using python tornado http://www.tornadoweb.org/en/stable/ or aiohttp (Python3.4+) http://aiohttp.readthedocs.io/en/stable/. Many of the implementations of Django with asynchronousity through gevent are outdated, experimental or abandoned, I found this https://github.com/jrief/django-websocket-redis but it uses Redis so no reason to not going back to django-channels.
In my opinion, as Socket.io is a layer over Websockets you will not find any project that supports fully the Socket.io spec as a ws server in Python as it is a native Node.js not officially ported to Python project, at least the latest one you are probably using, if you really need Socket.io features stick to Node.js and create a simple REST API in Django to load the backend data asynchronously from Nodejs (the REST django API will always be synchronous by nature), this is the best shot you would likely have.
https://github.com/django/channels/blob/master/docs/getting-started.rst
django-channels works with python3 and django >=1.8 :)
And you can change pip to pip3

python library which can be used for vSphere WS SDK

I am looking for a python library which can be used for accessing vSphere WS SDK. I have came across two which are having non GPL license:
psphere - https://github.com/jkinred/psphere
pysphere - https://code.google.com/p/pysphere/
Has anybody used these in production. I do not want these for test automation but for a product which could go on a scale of upto 25K VMs.
I saw this post Python - VMWare vSphere (WEB SDK) - SUDS. But there he seems to be using it for test automation only. Also I am not only looking for VM operations but also other objects like Host, Cluster, PortGroup, vDS etc.
Regards,
Litty
VMware has published an initial release of their vSphere SDK for Python two weeks ago: pyVmomi
I don't know psphere or pysphere but I've used Suds to access the vSphere Web Services. Worked pretty well.
The vSphere WS API is SOAP based and,to the best of my knowledge, exposes everything that's possible via vCenter. It's a bit tricky sometimes, but you can do it.
I don't know what you try to achieve but you should be able to do it with Suds. Of course, you'd have to familiarize yourself with the API: vSphere Web Services SDK
At the moment, we're playing around a bit with vCenter Orchestrator. It's a nice tool (since 5.0). Maybe that's an option for you, too.

can python (version 2.6 ) create web services on the windows(32)?

can python (version 2.6 ) create web services on the windows(32)? i hava a program that need python create a web service project.python 2.6 linked to mysql.
In China , less men develop it,so i can't find modules for web services!!
if not,Linux may be the next step.
http://wiki.python.org/moin/WebFrameworks. There's a ton of web frameworks for Python that will work on any platform. I'm not sure exactly what you mean by "web service", but I promise you that you'll find something that meets your needs on that list.
You can start by taking a look at:
Best way to create a simple python web service
Werkzeug
WebServices - PythonInfo Wiki
Dive Into Python: SOAP Web Services
Python Web Services

How to run PHP and Web.py together

I normally web develop in PHP. I am working on a python based project, and want to make a front-end web site for it.
I looked at web.py, and I was wondering if PHP can be used together with web.py, or would I have to rely completely on python as the server side scripting?
Thanks.
Combining web.py and PHP doesn't really make sense. But you can definitely set up Apache to have both. You just install mod_php and mod_wsgi. Point mod_wsgi to your web.py WSGI function, and set up your PHP web app in some directory where Apache can find it. You won't be combining the two technologies, but you will have separate web applications on your server that separately use the two technologies.
If you're using web.py, you should probably go with Python for server-side scripting. Mixing Python and PHP is definitely possible, but it seems to be going a little too far just to get the features of web.py.
Speaking of the features of web.py, if you want a similar framework I'm sure there are many which express the same principles.
There is one here: http://code.google.com/p/webpy-php-port/ (seems to be dead)
Good luck!

REST web service in python 3?

I'm new to the python world and I'm currently in a new project using it. So since we we're there to learn, we chose to start with python 3. Now, we need to make a RESTful web service. After reading a few, I found out that the most used framework for web services is Django... and I also read on the Django website that it does not yet supports python 3.
Is there any other API that I could use in order to make a RESTful web service?
Thank you.
CherryPy has a Python 3 branch. Not sure how advanced it is, but if Fu-manchu passes by this question, he will be able to tell you.
The Bottle framework claims to work with Python 3. You might inquire on their google group for details.
I really like to use bottle and run it on cherrypy. This is really easy, do everything per bottle instructions, and then in the run line, tell it to use cherrypy as it's server.
Exampple:
app.run(host='localhost',
port=8080,
server='cherrypy',
reloader=True,
debug=True)

Categories

Resources