What is the best way to use the amazon Product Advertising API in Python?
Seen previous answers, but all outdated and closed.
Most modules for the API call urllib which has errors with Python3 and SSL’s.
If anyone could give me the best way to work with it, it would greatly help.
Thanks
If you want to call the api yourself, then I find the requests module fantastic! Otherwise there is an AWS SDK for Python that you can use.
The boto3 library is excellent and actively maintained. It doesn't have much support for MWS, but does support AWS very well.
The AWS has their own python CLI package.
https://aws.amazon.com/cli/
pip install awscli
Related
It's something new for me working with API, but I really want to create something good. Maybe somebody of you've already worked with Tumblr API (not necessary with Tumblr, it can be Twiter or something else ) and could show me the simplest examples of retrieving of some data.
P.S: I've read the documentation of using API but I don't know how it works and what I should do to get the data. So if you can, I'll be very happy.
I was advised to use a Tumblr client, but now there is new question. How to install and how to use it in my own code?
You can use the official Tumblr client
If you want to write a client from scratch take a look in requests library.
A simple GET request will be something like this requests.get('https://api.github.com/user')
Use pip to install python packages.
After installing... From the shell, run:
pip install pytumblr
or
pip3 install pytumblr
I'm trying to get Google sign-in working using their Python API but the server I'm on (4UHosting) has Python 2.6 and pyOpenSSL 0.10-2 (5-years old).
This means that the API's call to OpenSSL.crypto.verify() fails as it doesn't exist in this version.
I can't install these myself, even --self as they require compiler use which I don't have. The admins are reluctant to install any updates that are not vetted. They won't install pyOpenSSL or Python 2.7 locally just for me. I can't find documentation from pyOpenSSL 0.10-2 that would have an equivalent function to verify().
I'm looking for some suggestions as where to head from here.
Any suggestions would be greatly appreciated,
Cyrille
A few ideas:
You could directly make your API calls to the Google API Endpoints instead of using the Python client library, for example, the token info endpoint can be used to verify tokens
You could do sign-in operations client-side and transfer data to your server once a session is attached
You could use another language (e.g. Ruby) for the sign-in operations
I'm wondering... in the "new" AWS CLI tool, which would be the equivalent to the "old" ec2-import-instance command? Can't find anything useful in the AWS Docs, help output or on the web.
Reason why I'm asking is that I'm curious to see their Python implementation of it, as I want to incorporate it into my own code. AWS CLI uses Python/boto (as opposed to the old API tools which used Java), which might be an explanation why the functionality is missing (couldn't find it in boto either).
If you happen to know how to achieve an instance import in pure Python, I'd be very curious about that too!
Any pointers are greatly appreciated. Thanks!
It will be supported in a later release. As of now, there is no support for it.
For more info
I intend to use Amazon S3 in my Django project, what's the difference between Amazon's official S3.py and boto.s3? Which one should I use?
I suppose that, by S3.py, you are referring to the code available to download here. So, please correct me if I am wrong.
In this case, IMHO, boto has some advantages, as pointed out at the Getting Started with AWS and Python tutorial:
Bar none, boto is the best way to interface with Amazon Web Services (AWS) when using Python. After all, It has been around for years, has grown up alongside AWS, and is still actively maintained.
Boto also has a good documentation, and an active mail list.
On the other hand, take a look at the last documented update to S3.py, and particularly when it happened:
2007-11-05: Updates to support EU
And this is another thing that got me thinking (remember that Python 3.3.0 beta is out there):
This sample was built using Python 2.2.3.
So, my recommendation is: you should use boto.
I want to use Tumblr's API v2, which includes OAuth. so I need to find a OAuth module.
I am supposed to use it like this:
import oauth2 as oauth
I have found the oauth2 source code here: https://github.com/simplegeo/python-oauth2
If I want to use it in my Linux Ubuntu 10.08, whats the process? I have installed git. I notice that there is a "setup.py", so I just have to run it? The ReadME https://github.com/simplegeo/python-oauth2/blob/master/README.md doesnt mention how to install, maybe it is too newbie.
If I want to use it in Google App Engine, how can I do it?
Thanks for your help. I am pretty new to GIT stuff.
On Ubuntu, simply sudo apt-get install python-oauth2 and the package will be installed for you automatically.
For AppEngine, you might take a look at the Google API Python Client's appengine examples. They have an OAuth2 client specifically designed to work with AppEngine.