Payment gateway with Python SDK compatible with GAE - python

I'm looking for a Payment gateway that offers Python SDK which would run on GAE. So far I've looked at Braintree[1] and TrustCommerce[2], and both required C-based libraries to work, which won't work on GAE. If there's no such thing, which payment gateway would you recommend that provides a possibly JSON-based API or a nice RESTful API.
[1] http://www.braintreepayments.com/
[2] http://www.trustcommerce.com/
Braintree uses PycURL library which is C-based
TrustCommerce comes with some C files that need to be compiled during install
EDIT:
I'll vote close on this, because it's been suggested that such thing is impossible because URLfetch has a 10 second limit which is not sufficient in this case. For those interested, it has been suggested to me that using a proxy for payment processing would be better.

It would be really helpful if you provided links. I googled and found this TrustCommerce, but I guess maybe it's a different company to the one you are talking about because they say there is sample Python code.
I didn't sign up for a trial account just to see if the Python API requires a C library. Afterall maybe it's not even the same TrustCommerce you have looked at.
This isn't really the right site to do your research, you should come back and ask for help if you have problems using the API when you have found/chosen one.

Related

get twitter feed (R or python)

I used to get twitter data using R with an xml package. Seems like they no longer use xmls and only use json. I tried a few methodologies with json and I keep getting an error saying API 1.0 not available anymore and I need to use API 1.1. Fine but there seems to be no clear documentation in how to.
Can someone guide me to a location or provide sample code for getting twitter data.
I used to do this in R but seems like python is better for this. If someone can provide a guide in either or both would be very much appreciated.(or some sample code with explanation)
Thanks
I recommend using sixohsix's twitter library for Python.
There is some documentation on the github page, and if you're familiar with at least a bit of Python (I didn't know Python very well when I started using it), then it's pretty easy to use. It supports API v1.1 (v1.0 is deprecated and doesn't even work anymore, afaik).
With some Python scripts on a Ubuntu netbook I was able to continuously query the API for almost a year now, without one crash. I wouldn't recommend R for this, especially if you're after a lot of data.
You can still use R for data analysis, you can actually plug it into your Python scripts directly using rpy2.
This package might be useful. It was just released a few days ago.
twitteR package for R
The Twitter API was updated from version 1.0 to version 1.1. Many codes are now defunct since authentication is needed. Many blog posts with code samples are no longer valid.
For Python, I prefer the bear's package.
For R, I think the standard package is twitteR.
Whatever you do, you'll have to authenticate your "application" as a developer: link.

Create python soap server based on wsdl

I have an wsdl file describing the communication server-client on a Java product.
I'm implementing a new server based on Python that will implement the same services.
Do you know of any method to create the Python server code based on the wsdl, that does not requires me to write all of the complextypes involved?
Also, what Api do you recommend?
This question has not received enough attention.
The currently accepted answer is good, but its answer is 'no'. Is there really no reasonably maintained and general solution?
Unfortunately, I don't think the negative answer is due to lack of attention to the question. There really is no support for WSDL in python. If you want to avoid the complexities of building your own soap envelope from scratch the only thing I can recommend you is building a sample envelope using any of the many soap webservices tools (soapui for instance) and then use it as a template string (I know, horrible) in your python code
UPDATE you could use spyne. It's a python RPC toolkit that among other protocols supports SOAP. It will create the WSDL for you, but if your objective is implementing the service described by the WSDL you already have then you'll have to fine tune your spyne service (written in python) until the generated WSDL matches the original
When it comes to SOAP support, Python unfortunately no longer is with "batteries included". The support on client side is acceptable but on server side you are basically on your own.
You might want to look at the following for starters:
http://wiki.python.org/moin/WebServices
http://pywebsvcs.sourceforge.net/
http://doughellmann.com/2009/09/01/evaluating-tools-for-developing-with-soap-in-python.html
If you really want to go on this route, it seems that ZSI is the tool to use, although I have my doubts that it will work with the latest 2.x Python distribution.
Using Python 2.6.6, I tried to use ZSI 2.0 to build a web service starting from the WSDL. Got some "module has been deprecated" warnings when generating the code with wsdl2py and wsdl2dispatch, had to separately install PyXML and hack my sys.path just to make it resolve first or else I got "module ext.reader does not exist" then only to end up with a disappointing "ZSI:EvaluateException Got None for nillable(False), minOccurs(1) element" error on a basic "Hello world!" WS with a required element.
Switched to ZSI 2.1_a1 which no longer needs PyXML and wsdl2py does it all (what wsdl2dispatch did for 2.0) but still ended up in a dead end with "ZSI:EvaluateException Got None for nillable(False), minOccurs(1) element" errors.
The experience wasn't very fun but it was enough for me to form an opinion about what Python has to offer for SOAP web services... which ain't much (and that was just for basic web services nothing fancy like WS-* specs). YMMV!
EDIT : I recently bumped into this SO question, and although oriented versus a client solution, it does also mention a few libraries for building SOAP services.

Using python-twitter behind a proxy

I have "created" a Twitter parser in Python 2.7, which pretty much can parse everything available from the API. As everyone else the REST API limit is killing me. I am trying to create a social graph (pretty big I'd say) and time is of the essence. So I thought, what if I could use a proxy? And the fact is I managed to with urllib, but any try to recreate the parser with urllib this would destroy all the hours put into python-twitter. So my Extended(question) is, can someone please explain how to patch the twitter.py with these instructions: http://code.google.com/p/python-twitter/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary&groupby=&sort=&id=205
Or even better, anyone knows any similar workarounds the REST API limit? Moreover, are any other python modules offering oAuth and proxy support?
I'm not sure whether python-twitter supports proxy. But, there is a project which implements proxy support for python-twitter. Have a look at https://github.com/dhananjaysathe/python-twitter-with-proxy

Python libraries for integrating Django with Facebook

I decide to write some applications using facebook and django (or even twisted, but it doesn't matter), and now I can't choose appropriate tools. I see there are many API-wrappers writed on Python exists for Facebook:
official, but seems no longer supported Python-SDK
new and actively developed, but seems too new Django-facebook
good old, but not maintained pyfacebook
simple, well-maintaned, but non-documented fandjango
some other very primitive tools
I saw some similar questions here, but I'm noticed that Facebook is periodically introduces big changes into their API and those advices may be already outdated, or may be new libraries appeared.
Also I'd like to know about most significant differences between those libraries. And of course good documentation and tutorials are welcome.
I think Django Facebook is a good choice for you. But my opinion is biased. I've written it for my startup Fashiolista.com and we run it in production. (Quite huge, so most edge cases have been resolved)
Django Facebook also include OpenFacebook, which is a python api client to the open graph protocol. It's the only python client I know which is fully up to date and actively maintained.
Have a look at:
https://github.com/tschellenbach/Django-facebook
PS.
Just released some new decorators which make it very simple to get started. These decorators are indeed very new and caused some bugs in the past days. The project itself is already a year old (since the open graph api was released) and otherwise quite stable.
http://www.mellowmorning.com/
The answer really depends on what it is you want to achieve as those APIs are pretty different.
pyfacebook - is for the older legacy API.
python-sdk - is for the "new" opengraph protocol (I wouldn't say its no longer supported as its just a thin wrapper over the facebook opengraph protocol, so supports all the new features that facebook provide instantly w/out needing dev work on the lib).
django-facebook - is a higher level than python-sdk and helps you to add facebook connection features to your site and also seems to pave the way to creating apps that live "inside" facebook rather than just helping sites that live outside facebook to get access to facebook data.
Never heard of fandjango and github seems to be down at the moment so can't comment on that.
If you just want to add user-login using facebook then something like django-socialauth might work out well for you.
If you want to start exploring the social graph then python-sdk is the way to go.
I'd also check to see if the functions you want are supported by the opengraph protocol, its improved over the last year but there is the odd thing it frustratingly doesn't support whereas the legacy api does support...
The best documentation is facebook itself, check out the graph-explorer - it's pretty fascinating...
It depends what you are trying to do. I had the same problem and ended up using django-social-auth , which lets you log in via Facebook and many other social networks.It also lets you extract the token from those networks and then use it.
For the facebook specific stuff, I use facebook-sdk, but since you have something managing the tokens, you could really replace it with any library if yours become outdated in upcoming years . It also means you can add more social networks later on.

Bloomberg Server API and Ruby/Python

Im looking to write a new application in ruby/python which uses a feed from bloomberg and am stuck trying to find any documentation for using (or even setting up) Bloomberg Server API with either of these languages.
Does anyone have any good links to tutorials for this or maybe some boilerplate code to get set up? Or is it best to just stick to the three main supported languages?
The Bloomberg Open API (BLPAPI) v3.5 release now includes a native Python SDK.
http://www.openbloomberg.com/2012/11/21/open-api-blpapi-v3-5-x-released/
Did you check out some questions at SO on this. It might help you
Bloomberg API request timing out
Asynchronous data through Bloomberg's new data API (COM v3) with Python?
Resolver is an spreadsheet implementation in IronPython and has a very good integration for Bloomberg API
http://www.resolversystems.com/documentation/apidocs/MarketData_Bloomberg.html
Here is a simple Client access API which I wrote with the help of the mentioned links as well as some others. Not everything is implemented but it is a good start.
https://github.com/bpsmith/pybbg

Categories

Resources