rmed.blog

Posts tagged 'api'

Wrapper for EMT Madrid API

28 May 2016

EMT Madrid, (the organization that operates the buses in Madrid), offers a public API with information such as waiting times, stop locations, etc.

I used this API some time ago to develop the madtrans Zoe agent: I performed the requests manually and parsed the data accordingly, although I only implemented some of the endpoints offered by the API. After a while I thought about creating a wrapper for the API in order to use it to improve the agent.

With the documentation available, I started developing the wrapper. I am not ashamed to admit that this development lasted less than a week: I got somewhat frustrated with some particular things of the API and put the project aside. Some weeks ago, however, I decided to continue developing the wrapper because of another project of which I will not talk about just yet.

The result is the pyemtmad wrapper for Python! It is definitely not perfect, but at least simplifies things greatly for me and kind of works. In order to use it, you just need credentials to access the API and instantiate a Wrapper as follows:

from pyemtmad import Wrapper

wrapper = Wrapper('MY_ID', 'MY_PASSWORD')

All the endpoints are then available through attributes of the wrapper object. Parameters and further details are available in the documentation.

Hope it is useful for someone!

Tags: python emt wrapper api transport

The server is full!

06 Jan 2016

Ok, even I have to admit this is getting a bit out of hand. You see, some weeks ago I started subtly influencing my brother so that he would start playing the MMO Guild Wars 2 with me, given that it recently became free-to-play.

He finally agreed to do it (yay!), if I came up with a name for his character. I asked a friend for help and we came up with a list of names, including some hilarious ones that my brother discarded right away. Anyway, before he could create his character, he had to choose a server to play in and I told him which was the only Spanish server, but it was full. Huh, weird. We tried again the next days with no luck, so I thought of something (you must surely know what is coming).

Tags: zoe gw2 api game bot agent