I am trying to retrieve a photo (the .jpg file) from a Picasa album using the gdata Google API. However I did not find any method which does it, even though it is possible to upload a photo using methods like InsertPhoto and InsertPhotoSimple.
I guess I must be missing something :-(. A simple example would help.
Client API provides methods only for obtaining information on photos: http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_python.html#Photos
To retrieve an image, use an HTTP GET with information previously obtained. Read the documentation.
For this purpose you may use a Python library:
httplib
urllib2
Related
I am attempting to find the Image for an instance on Google Cloud Platform using the Google Python SDK. So far, I can get the instance, get the disks for the instance, find the boot disk, and extract the sourceImage and sourceImageId fields from there. However, since my instance and disk are in a different project from the image, I'm having trouble getting the actual image object.
The disk's sourceImage is https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20200420 and its sourceImageId is 2742482894347998968.
My question is similar to a previous question (GCP Python SDK - Get data from the googleapi url's) except that I would like to find the best-practice method. The lone answer on that question recommends using the URLs in the metadata to get the related object but there is a comment that indicates that the URLs in object metadata are not real URLs which makes me think they should not be used directly. All I need is the project (centos-cloud in this case) for the image and I can use the sourceImageId to get the image object. I could extract the project from the URL pretty easily but that seems fragile. I looked through the documentation to see if there was a built in function to extract the project or get the image using that URL, but I didn't find one.
Is there something I have overlooked? Or is this not a supported workflow? Or did I misinterpret John Hanley's comment and I should just use that URL to pull the image?
TL;DR: Given only a disk's sourceImage (eg. https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20200420) and sourceImageId (eg. 2742482894347998968), how can I programatically get the Image object from the API?
google-api-python-client==2.45.0
Python 3.10
i am trying to use the requests library with python to fetch data from the traffic api with python.
this is the link for website with api that should include the traffic data:
https://api.tomtom.com/traffic/services/4/flowSegmentData/relative0/10/json?point=52.41072%2C4.84239&openLr=true&jsonp=jsonp&key=3EeqxQCR2DNsYzRCT0RPIxUhlzAM3hQc
but it returns an "Developer Inactive" on the website . how to solve that and use the api
also i want to ask if this will work with kivy.
API request that you provided has an API key that is not existing anymore. I tried it with your API key that you provided in the comment and it worked. But you must notice that you copied it wrongly - there is an additional character at the beginning.
How to structure GET 'review link' request from Vimeo API?
New to python and assume others might benefit from my ignorance.
I'm simply trying to upload via the new vimeo api and return a 'review link'.
Are there current examples of the vimeo-api in python? I've read the documentation and can upload perfectly fine. However, when it comes to the http GET I can't seem to figure it out. Im using python2.7.5 and have tried requests library. Im ready to give up and just go back to PHP because its documented so much better.
Any python programmers out there familiar?
EDIT: Since this was written the vimeo.py library was rebuilt. This is now as simple as taking the API URI and requesting vc.get('/videos/105113459') and looking for the review link in the response.
The original:
If you know the API URL you want to retrieve this for, you can convert it into a vimeo.py call by replacing the slashes with dots. The issue with this is that in Python attributes (things separated by the dots), are syntax errors.
With our original rule, if you wanted to see /videos/105113459 in the python library you would do vc.videos.105113459() (if you had vc = vimeo.VimeoClient(<your token and app data>)).
To resolve this you can instead use python's getattr() built-in function to retrieve this. In the end you use getattr(vc.videos, '105113459')() and it will return the result of GET /videos/105113459.
I know it's a bit complicated, but rest assured there are improvements that we're working on to eliminate this common workaround.
I'm working on an app which wraps Google Docs (using GAE/Python), and I want to keep track of who is viewing these docs in real-time. I can't find any APIs for this in the Google Drive SDK.
What's a good way to do this? Naively, I might imagine repeatedly polling each document individually and parsing the returned HTML. I expect there to be ~150 docs total in the system; would this be too inefficient?
Realtime api is not for using with gdocs, only for your own custom formats. Instead see the changes api in drive but you wont be able to detect viewers only modifications https://developers.google.com/drive/manage-changes
I am not sure if this meets your requirement but there is a Realtime API available in the Drive SDK.
The catch is that it is JavaScript only. It does have Events that your web client can be notified off like CollaboratorJoinedEvent and CollaboratorLeftEvent.
I did lots of search for Google Image Search using local image but not found any accurate answer. like what are the parameter we have to pass when upload a photo to google server. so any one know how i can use Google Image search for searching local image stored in my harddisk but using python programming. tell me if any Library or API available. Thank you in advance.
This looks like a duplicate of this question:
Google Search by Image API?
The Google Image API is deprecated but as the answerer points out, there are alternatives like tinyeye.