EuroPython website sprint a success - many new features implemented

Last weekend the web team met in Berlin (and was supported by one member remotely) in the rooms of Veit Schiele Communications GmbH in order to bring the EuroPython 2014 website software forward. The team under the leadership of Markus Holtermann implemented the following new features:

  • A short while ago we made some heavy changes to the main menu. Unfortunately the user experience wasn’t the way we expected it to be. Thus we got some comments on the EuroPython mailing list. It took us some time to decide how to change the way the menu should work. Eventually, a click on a main menu item only toggles the menu as of now (GitHub issue #103)
  • We want to generate the badges (and other stuff for the conference) directly from the user data you provide on the website. This presented us with some kind of challenge as you will see in the next bullet point, too. We decided that the singe point of truth for the user data is the user profile. We therefore added a field where you can enter your interests. (GitHub issue #105)
  • As said before, the single point of truth for the user data is and will be the user profile. Unfortunately, during the purchase process of a ticket, we only have information about the buyer, not any of the intended ticket users. Although we didn’t change this part in the update (and we won’t change it in the future), you are now able to assign a ticket to another user. This is incredible useful for those buyers ordering multiple tickets, eg. for their colleagues or friends. To assign the ticket to somebody else, ask him/her for the user name and assign the ticket to him/her from your purchase view. If the intended user doesn’t have a account yet, ask him to create one. All tickets that are not assigned to somebody will use the first and last name given during purchase. (GitHub issue #101)
  • Since many attendees are not from Germany, we looked for a way to hand out SIM cards. Due to legal restrictions this is not that simple in Germany (you normally need to present a photo ID). Fortunately we found a reseller where we become some kind of reseller ourselves (it’s a bit more complicated than that ;) ). Hence we will offer SIM cards within the next days that you can buy beforehand and you can pick up during check-in (more details soon). (GitHub issue #100)
  • When you modify your profile and try to upload a new avatar, but there are errors in some other fields, the avatar gets lost. We solve this by adding front-end validation to this and many other forms. (GitHub issue #47)
  • If you are looking for a job (in your real live, not the one on the internet :D), or if you think about getting a new job for whatever reason, you can now opt-in (and later opt-out) of job offers by our sponsors. We will not hand over any of your data to the sponsors. The sponsors have to give us their offer and we will send it only to those users interested in job offers. (GitHub issue #78)
  • The list of your purchases now shows canceled purchases too. (GitHub issue #102)

Apart from those changes interesting to you as an attendee, loads of other changes made it into production. If you are interested, have a look at our repository on GitHub: https://github.com/EuroPython/djep

All new features went into production today with an update of the portal software.

Thanks a lot to the web team and all other sprinters for their dedicated work on the EuroPython 2014 web software.

Source: blog.europython.eu, Mar 30, 2014, 20:30pm CEST


EuroPython 2014 Conference in Berlin at the bcc Berlin Congress Center

EuroPython 2014, July 21-27, Berlin

The next EuroPython conference will be held from July 21 - 27, 2014 at the bcc Berlin Congress Center in the heart of Berlin. The EuroPython conference is the second largest global conference for the popular programming language Python, after the PyCon US conference in North America. The bcc is located at the central Alexander Square. It offers ideal facilities for a developer conference on 3,000 m2. The organizers are expecting up to 1,200 participants, continuing the growth of the EuroPython conference series. The very successful EuroPython this year attracted almost 900 Python enthusiasts. It was hosted in Florence, Italy for the third time running.

Berlin offers ideal conditions for a large international developer conference. The city with its about 2,500 young businesses has a large and fast-growing start-up scene. 300 universities, polytechnics, research institutes and technology parks underline Berlin’s importance as one of Europe’s leading science and research locations. Thanks to its rich cultural landscape with around 180 museums, renowned international art collections and precious works of art as well as a lively art and music scene, Berlin is one of the most vibrant and vividly creative metropolitan centers in Europe. Its attractions and excellent national and international transport links have already put Berlin among the top three in the international conference and congress region rankings.

The conference will be organized locally by the Python Software Verband e.V., the Python Users Berlin, the Django User Group Berlin and the PyLadies Berlin, in cooperation with the EuroPython Society for the Python community. With five lecture tracks and two tutorial tracks running in parallel, the EuroPython conference offers an attractive schedule for all attendees.

The EuroPython 2014 logo expresses what is on the organizer’s minds, which is getting people from very different areas of expertise together to communicate. Python is used as a programming language in industrial and service enterprises as well as in research and education. The EuroPython brings together developers who work together on fascinating tasks and as a result have found unique solutions to their problems.

About Python

Python is an interpreted high-level language. In the TIOBE index Python has featured among the top 10 of favorite programming languages for years. Python is ideal for development. It is a lean language that is easy to learn for both developers and users. The language was created in the late 1980s by Guido van Rossum. Today, the language is developed by a large open source community and backed by the Python Software Foundation (PSF), which owns the copyright to Python.

About the Python Software Verband e.V.

The Python Software Verband e.V. represents the interests of the German-speaking Python community. It is a German non-profit organization that focuses on promoting the Python programming language and supports activities of different Python interests groups. Its members are involved in a wide range of Python activities including Python core development and many Open Source projects.

About the EuroPython Society

The EuroPython Society (EPS) is a Swedish non-profit organization which holds the rights to the EuroPython conference series and trademarks. It coordinates with local organizers to run EuroPython conferences. The EPS was formed in 2004 with the mission to turn EuroPython into a successful Python conference series for the years to come.

About the Python Users Berlin

Founded in 2002, Python Users Berlin holds monthly meetings for presentations and talks about all facets of the Python programming language. Python Users Berlin currently has around 330 members.

About the Django User Group Berlin

The Django User Group Berlin was founded in 2009. Its approximately 130 members meet monthly for talks related to the Python web framework Django.

About the PyLadies Berlin

PyLadies is an international movement that motivates and supports women to engage with and take an active role within the Python community as developers. PyLadies Berlin has around 100 members.

Source: ep2014.europython.eu, Dec 12, 2013, 11:30pm CET


bakery — Where cookies are made!

It has been some time since my last blog post. So here’s an update. This is about a great event I participated in last weekend, the djangodash 2013.

The djangodash is an coding contest where teams have 48 hours time to start and sprint a project. As this dash is called djangodash, the Django must be used. Furthermore the teams are limited to at most 3 members and a couple of other rules.

So, what project were my friend and I working on? It’s called bakery. You can find it on github as well as a live version at djangodash2013.webshox.org. But what does bakery actually do and what is it? In simplified terms bakery is an index for cookiecutter templates. In longer terms, bakery offers an API to create, find, modify, update and share cookiecutter templates at a central point to clear up the mess with manually updated readme files providing an incomplete list of templates. Additionally bakery offers some neat features such as forking a template to your own github account or voting a template up. We are working on many more planned features, e.g. automatically updating the index, directly editing the cookiecutter.json file on the index.

So, what are these cookiecutter templates and what is cookiecutter? cookiecutter itself is a tool that, given a project template, bootstraps a project with its directory structure and files (including their content) based on a set of context variables. To see what these templates (aka cookiecutters) look like, just have a look at the list of available cookiecutters.


Showing BVG Departures In Your Office

Yesterday evening I gave a lightning talk at the Python User Group Berlin called "Showing BVG Departures In Your Office". You can download the slides here.

The whole idea to the project came up when our student organization (Freitagsrunde) had to relocate to a new building at the end of 2012.

Since our new student organization meeting room is quite near to the next bus stop (bee-line), but the actual distance is way longer and we have to cross several doors, waiting in the room and heading to the bus stop when the bus arrives is not going to work.

As computer scientists we had to come up with a solution to somehow grab the departures of the bus stop and show them in the room.

  • bvg-grabber in use
  • bvg-grabber in use

At first the information retrieval was hard-coded and it was only possible to get the departures for a single bus stop. After a short time we got the feature request to also display the departures of nearby subways and other public transport. We ended up rewriting the entire application and created a library we then called bvg-grabber.

The quite simple API allows us to use both information provided by the BVG: the actual departures which, in that days, only returned departures about busses, and the scheduled departures as they are written on the time tables:

A class inheriting from QueryApi must implement a call() function that returns a Response object.

class QueryApi(object):
    """Performs the requests to the data source"""

    def call(self):
        """Needs to return a Response"""
        raise NotImplementedError("The inheriting class needs to "
                                  "implement the call() method!")

A Response object must contain a state (True/False for success/failed request) and, for a successful request, the departing station and a list of Departures, or, for a failed request, the error that occurred.

class Response(object):
    """Returned by a QueryApi, contains list of Departures"""

    def __init__(self, state, station=None, departures=None,
                 error=None):
        self._state = state
        self._departures = [(station, departures)]
        self._error = error

    @property
    def departures(self):
        return self._departures

Finally, a Departure defines when a certain line leaves at a certain start station and at which station the ride will end.

@total_ordering
class Departure(object):
    """Start and end station, next departure time"""

    def __init__(self, start, end, when, line, since=None,
                 no_add_day=False):
        # Some magic happens here

As we are using the actual and the scheduled information from the BVG as you can see above, here are 2 short examples how to use them:

In [1]: from bvggrabber.api.actualdeparture import ActualDepartureQueryApi

In [2]: resp = ActualDepartureQueryApi("Ernst-Reuter-Platz").call()

In [3]: resp.departures
Out[3]:
[('Ernst-Reuter-Platz',
  [Start: Ernst-Reuter-Platz, End: S+U Zoologischer Garten, when: 13:56, now: 13:54, line: Bus 245,
   Start: Ernst-Reuter-Platz, End: S+U Zoologischer Garten, when: 14:01, now: 13:54, line: Bus X9,
   Start: Ernst-Reuter-Platz, End: S+U Zoologischer Garten, when: 14:05, now: 13:54, line: Bus M45,
   Start: Ernst-Reuter-Platz, End: Johannesstift, when: 13:54, now: 13:54, line: Bus M45,
   Start: Ernst-Reuter-Platz, End: Flughafen Tegel, when: 13:55, now: 13:54, line: Bus X9,
   Start: Ernst-Reuter-Platz, End: Johannesstift, when: 14:01, now: 13:54, line: Bus M45])]

In [4]: from bvggrabber.api.scheduleddeparture import ScheduledDepartureQueryApi

In [5]: resp = ScheduledDepartureQueryApi("Ernst-Reuter-Platz").call()

In [6]: resp.departures
Out[6]:
[('Ernst-Reuter-Platz',
  [Start: Ernst-Reuter-Platz, End: Johannesstift (Berlin), when: 13:54, now: 13:54, line: Bus  M45,
   Start: Ernst-Reuter-Platz, End: Hertzallee (Berlin), when: 13:56, now: 13:54, line: Bus  245,
   Start: Ernst-Reuter-Platz, End: S+U Pankow (Berlin), when: 13:56, now: 13:54, line: U2,
   Start: Ernst-Reuter-Platz, End: Hertzallee (Berlin), when: 13:57, now: 13:54, line: Bus  M45,
   Start: Ernst-Reuter-Platz, End: U Theodor-Heuss-Platz (Berlin), when: 13:58, now: 13:54, line: U2])]

I’m looking forward to your ideas and feature requests.

Markus


Mirroring gitolite

A long time ago I wrote an article about how to install gitolite. Yesterday an article popped up in my feed reader that shows a short script on how to mirroring gitolite servers.

Since I wrote my custom script once I had set up gitolite, I was a bit curious about the differences to my script today. So I checked the referred script and noticed some problems that probably occur over the time:

  • New branches on the remote are not fetched
  • New tags on the remote are not fetched
  • Using working copies results in way larger mirrors

As one can see, the script lacks some major features.

#!/bin/bash
# Copyright (c) 2011-2013 Markus Holtermann
# MIT License: http://download.markusholtermann.eu/MIT.txt

BACKUP_DIR=/data/git-mirror/
REMOTE=git@git.example.com

if [ ! -d "${BACKUP_DIR}" ] ; then
    mkdir -p "${BACKUP_DIR}"
fi

cd "${BACKUP_DIR}"

for repo in $(ssh ${REMOTE} 2> /dev/null | grep -e "^\s\+R" | sed -e 's/\r//g' | awk '{print $3}')
do
    if [[ -d ${repo}.git ]] ; then
        cd ${repo}.git
        echo "Updating ${REMOTE}:${repo} ..."
        git fetch --all
        echo " ... done"
        cd -
    else
        echo "Cloning ${REMOTE}:${repo} ..."
        git clone --mirror ${REMOTE}:${repo}.git
        echo " ... done"
    fi
done

The magic to prevent working directories lies in the --mirror parameter while cloning a repository. To get notified about new branches and tags on the remote side, I use git fetch --all. The man (1) page to git-fetch describes it as

Fetches named heads or tags from one or more other repositories, along with the objects necessary to complete them. […]

However, the script above does not remove branches/tags that don’t exist on the remote any more. Since I use the script only for backup purposes, I don’t need that feature. But I would just remove all branches (local and remote) from the local mirror and would run git-fetch afterwards.

Enjoy the script.