Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Wednesday, December 17, 2014

Tortilla, a Python API wrapper

By Vasudev Ram



tortilla is a Python library for wrapping APIs. It's headline says "Wrapping web APIs made easy."

It can be installed with:
pip install tortilla
I tried it out, and slightly modified an example given in its documentation, to give this:
# test_tortilla.py
import tortilla
github = tortilla.wrap('https://api.github.com')
user = github.users.get('redodo')
for key in user:
    print key, ":", user[key]
That code uses the Github API (wrapped by tortilla) to get the information for user redodo, who is the creator of tortilla.
Here is the output of running:
python test_tortilla.py
bio : None
site_admin : False
updated_at : 2014-12-17T16:39:55Z
gravatar_id : 
hireable : True
id : 2227416
followers_url : https://api.github.com/users/redodo/followers
following_url : https://api.github.com/users/redodo/following{/other_user}
blog : 
followers : 6
location : Kingdom of the Netherlands
type : User
email : dodo@gododo.co
public_repos : 9
events_url : https://api.github.com/users/redodo/events{/privacy}
company : 
gists_url : https://api.github.com/users/redodo/gists{/gist_id}
html_url : https://github.com/redodo
subscriptions_url : https://api.github.com/users/redodo/subscriptions
received_events_url : https://api.github.com/users/redodo/received_events
starred_url : https://api.github.com/users/redodo/starred{/owner}{/repo}
public_gists : 0
name : Hidde Bultsma
organizations_url : https://api.github.com/users/redodo/orgs
url : https://api.github.com/users/redodo
created_at : 2012-08-27T13:03:15Z
avatar_url : https://avatars.githubusercontent.com/u/2227416?v=3
repos_url : https://api.github.com/users/redodo/repos
following : 2
login : redodo
Adding:
print type(user)
to the end of test_tortilla.py, shows that the user object is of type bunch.Bunch.

Bunch is a Python module providing "a dictionary that supports attribute-style access, a la JavaScript."

Did you know that tortillas are roughly similar to rotis?

- Vasudev Ram - Dancing Bison Enterprises

Signup for news about new products from me.

Contact Page

Wednesday, October 8, 2014

New: The Hacker News API (with Python support)


By Vasudev Ram


Hacker News (HN), a.k.a. news.ycombinator.com has introduced an API for their site - the Hacker News API.

Hacker News is a tech and other news site popular with developers, entrepreneurs and others, which was set up by Paul Graham, founder of Y Combinator, a startup incubator / accelerator.

HN thread about the Hacker News API.

The Hacker News API on Github.

The API has been built in partnership with Firebase, a startup that is a graduate of the Y Combinator incubator / accelerator.

There is a Firebase REST API available to access the Hacker News data.

They mention two Python wrappers for the Firebase REST API:

python-firebase, Python interface to the Firebase REST API, by Özgür Vatansever

and another one, also called

python-firebase, Python wrapper for the Firebase API by Michael Huynh.

The news about the Hacker News API was posted just today.

I'll experiment over some days with the API and then may write another post about using it from Python.

- Vasudev Ram - Python training and consulting - Dancing Bison Enterprises

Click here to signup for email notifications about new products and services from Vasudev Ram.

Contact Page

Wednesday, August 1, 2012

Mashape, Jeff Bezos-backed cloud API startup

By Vasudev Ram


TechCrunch reported Mashap's public launch.

Mashape is a startup that is a sort of marketplace for cloud APIs.

About Mashape

The Mashape team

Mashape is backed by Jeff Bezos, founder and head of Amazon.com, among others.


- Vasudev Ram - Dancing Bison Enterprises

Sunday, July 29, 2012

Twitter libraries list - from Twitter

By Vasudev Ram


Twitter libraries

The list mentions one or more libraries for:

ActionScript/Flash, C++, Clojure, ColdFusion, Erlang, Java, JavaScript, .NET, Objective-C / Cocoa, Perl, PHP, Python, Ruby, Scala.

- Vasudev Ram - Dancing Bison Enterprises

Wednesday, October 19, 2011

Text To Speech for Chrome Extensions, and Talking Alarm Clock

By Vasudev Ram - dancingbison.com | @vasudevram | jugad2.blogspot.com

Saw this recently on the Google Code blog

Tried it out some, it's quite cool and useful, IMO:

New Text-to-Speech API for Chrome extensions

http://googlecode.blogspot.com/2011/10/new-text-to-speech-api-for-chrome.html

As the title of the post indicates, this is about a new Text To Speech (TTS) API for Google Chrome extensions and apps.

Though the blog post title only mentions the API, the post also has links to TTS (i.e. talking) apps for Chrome. You can install them from the Chrome Web Store. There are also links to a couple of other "voices" that can be used for all such Chrome TTS (Text To Speech) apps or extensions. Even without installing the voices, you may be able to run TTS apps using the native voice support of your operating system

I tried out the TTS Demo and the Talking Alarm Clock - both were good.

The Talking Alarm Clock in particular can be useful. Apart from being useful, the audio alarm that goes off when the alarm time is reached, can be played in different ways - e.g., as a traditional ringing alarm clock, a digital alarm clock, a cuckoo clock, a grandfather clock, a "morning in the forest" tune, etc. Pretty cool ...

I had developed a simple utility something roughly like it in Delphi a while earlier

Posted via email

- Vasudev Ram @ Dancing Bison

Thursday, September 15, 2011

Picloud - publish Python function and call it via REST

By Vasudev Ram - dancingbison.com | @vasudevram | jugad2.blogspot.com

This looks interesting. Just saw it on Hacker News, maybe more later after checking it out.

Picloud - publish your Python function and call it via REST:

http://blog.picloud.com/2011/09/14/introducing-function-publishing-via-rest/


They have a simple three-step process for making your Python functions callable across the Net via REST:

1. Define your function (on your own machine)
2. Upload it to PiCloud via a method call on their library which you download (once only).
3. Call it via Python (or via the curl utility for manual testing).

JSON format is supported for the output.

Hacker News thread about it:

http://news.ycombinator.com/item?id=2999247


Update: the PiCloud team consists of former UC Berkeley graduates and the company has backing from Andreessen Horowitz and Kleiner Perkins, as per their site.

Posted via email
- Vasudev Ram @ Dancing Bison