Posts tagged: "python"

Using Selenium to parse a timetable

2016-09-27 17:31 +0200

The University of Greenwich portal offers a link to view your own timetable for any week or term. Even though it is useful, it would have been even more useful if it had a way of downloading the full timetable as an iCalendar file to import in calendar applications such as Google Calendar (other apps are available). I like being able to quickly access my calendar from my phone, but I am too lazy to copy the timetable to a piece of paper (which is what a friend suggested), therefore I wanted to try implementing a script to automatically convert the timetable to a .ics file.

Migration system for Zoe microservices

2016-08-03 16:42 +0200

This is the title of my Bachelor Thesis, which focused on the development of an addition to the Zoe virtual assistant that enabled live migration of Zoe agents during runtime. Rather than modifying the original system or employing solutions such as virtualization or containers, which may have been a little too overkill for this scenario, I designed and implemented a software-based solution with the help of my supervisor, Professor David ExpĆ³sito from UC3M.

Wrapper for EMT Madrid API

2016-05-28 13:36 +0200

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!


2015-08-19 09:55 +0200

Flask-WaffleConf is a Flask extension that allows you to store configuration variables in the database, read them on startup and update them on runtime. It's kind of an experiment in order to try making a Flask extension from scratch and add the functionality to the website in a modular way. If you are wondering about the reason behind the name, go ask @adolphenom @captainepoch.

The way it works is pretty simple:

  • You define a database model that will act as configuration store
  • Instantiate the WaffleConf object with the application
  • Register the view with any Blueprint

For the time being (you know... alpha state), I've just added a peewee configuration store, but creating stores for other databases should not be too complicated: simply subclass the WaffleStore class and you are ready to go. However, I would recommend checking the documentation first, just in case :)

Released under GPLv2+ license.

Comments, issues and pull requests are more than welcome!

infocards 0.2.0 released

2014-08-07 12:46 +0200

I have updated my infocards library to version 0.2.0. There have been some changes in this release:

In order to install the package, you can either download the source archive and do:

$ pip install /path/to/archive

Or install from the Package index (recommended):

$ pip install infocards

Note that fuzzywuzzy 0.2.1 is not available in the PyPI, so you must download it and install it from its GitHub repository-

infocards 0.1.0 released

2014-07-03 13:13 +0200

infocards is my new Python library for managing small and simple information cards in an archive (based on a SQLite database). Licensed under the GNU Lesser General Public License (v3).

In order to install the package, you can either download the source archive and do:

$ pip install /path/to/archive

Or install from the Package index (recommended):

$ pip install infocards

The library is compatible with Python 2 and 3.

breezedb 1.2.0 released

2014-01-03 13:52 +0100

As I said in a previous post, this release changes the way the library works drastically and is not compatible with previous versions.

Here's a rough changelog:

  • New license: GPLv2
  • New JSON structure
  • Database now consists of a single file
  • Improved special character support
  • Improved exception handling
  • Added several database operations

As always, report any bugs in the issue tracker.

Latest stable source code is available in the master branch of the Github repository and installed by running:

$ python setup.py install

Also installable via PyPI by using:

$ pip install breezedb