Posts tagged 'python'

Using Selenium to parse a timetable

27 Sep 2016

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.

Tags: spider university greenwich script scrapy selenium parse web python

Migration system for Zoe microservices

03 Aug 2016

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.

Tags: bachelor gul document thesis zoe academic python

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: transport api python wrapper emt

Good old text adventures

14 Mar 2016

Some days ago I fixed/updated my micro-engine for text adventures: texture. This project was first created for a minigame we had planned at GUL UC3M for an event at the University: El discurso de Zoe (Zoe's speech). Here is a showcase of the game in action (in Spanish).

Funny thing is, this is not my first project related to text adventures.

Tags: texture adventure text gul game python

WaffleConf and multiprocess

25 Aug 2015

Version 0.2.0 of Flask-WaffleConf has just been released and includes support for multiprocess deployments. Here I will explain the problems encountered and the "solution" reached.

Tags: waffleconf database multiprocess flask python extension


19 Aug 2015

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!

Tags: waffleconf python flask database extension

infocards 0.2.0 released

07 Aug 2014

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-

Tags: infocards information card archive library python

infocards 0.1.0 released

03 Jul 2014

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.

Tags: infocards information card archive library python

Introduction to distutils (III)

29 Jan 2014

Hey there! We have already seen how to write the setup script and how to build and install the Python module, but how about we distribute it so that anyone can download it? For this, we'll use the Python Package Index.

Tags: distutils breezedb distribute python setup

breezedb 1.2.0 released

03 Jan 2014

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

Tags: breezedb python database

1 2