Document Actions

Python Users Netherlands meeting 18 April 2013

Filed Under:

Summary of the meeting of the Dutch Python Users group on 18 April 2013.

We were welcome at the offices of Fox-IT in Delft for presentations, lightning talks and meeting fellow-Pythonistas.

(Note: my brother Reinout also made a summary.)

Reinout van Rees - Report on testing

Testing is good, but not everyone does it. How about making a report of who is actually writing tests and which project has commits with tests? With githubinfo you get a report of your projects on github sorted by the amount of commits that have tests in them. I send an email out to my colleagues with that info every week. The email also contains a list of committers sorted by the amount of commits with tests. This should help in getting people more aware of testing. You can configure it with a json file.

https://github.com/nens/githubinfo http://pypi.python.org/pypi/githubinfo

Ronald Evers - Dev'ing at Fox, how do they do it

I will show you a little bit about how we do development and operations here at Fox-IT. I am working on DetACT, fraud detection software for online banking. We try to detect fraud in the data stream. Low-level in C++, the rest in Python. We have sold DetACT to several banks.

We switched from subversion to git. We use Gerrit. This is a code review system. Before you are allowed to push to the master branch, you need to get two upvotes for your commits, which is done on the Gerrit server. You can compare it a bit with a pull request on github.

We use Jenkins for automated tests. This also works nicely in combination with Gerrit.

We have to respond quickly to new security attacks, so we deploy as often as possible. We use irc, Fabric, Sentry, Munin, Nagios, request tracker. Sentry is an exception tracker: what is going wrong on which server? We have built a simple irc bot for Gerrit that tells us on an irc channel what is going on with the code.

For writing an irc bot: https://github.com/ronaldevers/botlerplate

Alternatively: https://github.com/github/hubot

With Fabric we execute actions on several servers. It is like Make, but also works on remote servers. Selecting which hosts you want to deploy on is actually the hardest part for us. So we have built something for that. We change the globals() dynamically to add extra targets. It works.

JSON, HTTP and the requests library are your friends. Connect everything. Automate everything. Monitor everything.

Yes, we are hiring.

Jeroen Vloothuis - Get more attention for your project

Do not let your open source work lead to nothing. Or: how to let your project get the deserved attention.

A lot of people do open source projects, but they make a few mistakes in communication and the project does not succeed. So a few simple marketing tips to help you maximize your user audience.

People care about themselves. In documentation talk to the user: "This software lets you write efficient code." Get your users engaged. Emphasize what it does for them.

"Your project solves my pain, right?" That is what the user wants to know. Why would you write software when not to solve a real problem? "Django makes it easier to build better web apps more quickly with less code." Sounds good. Compare that with: "Flask is based on Werkzeug and Jinja2 and has a BSD license." Yeah? So? What can I actually do with it?

So: why did you start your project and what problems does it solve?

Talk about benefits, not features. "My project has a FrobNob 2000." Right. "My project saves you time." That could be useful. "Rely on MySQL to save time and money." Good. "We are blah compliant, have full support for blah." Excuse me? If you are ACID compliant, say something like "we will not corrupt your data."

So: focus on benefits. Features just support your claim.

A picture is worth a thousand words. In the case of Python the picture can be a few lines of source code, showing how easy it is to use your package. Show, don't tell.

So focus on:

  • your users
  • their pains
  • benefits first
  • pictures.

Question: Won't developers like the facts more? They do want to know if a database is ACID compliant.

Answer: Fine, but still start with telling that in simple terms.

Jasper Spaans - A talk about nothing

This is a lightning talk about nothing. I counted the zeroes and ones in the DetACT project. The zeroes clearly win, with almost sixty percent.

See https://github.com/jap/bittally

PEP-336: make None a callable object. That would be handy, as that would mean you can do None.endswith('wawawa') and it won't fail so you need less code. Guido denied this pep. I wrote this code if you want to use it anyway.

See https://github.com/jap/nihilo

Onno Broekmans - Programming scientists

PhD student at University of Amsterdam. I am wondering who you guys (and girls!) are. Lots of web development here, I think. I am working as a scientist. Scientists have invented the atom bomb, particle accelerator, and we do it with spaghetti code. Most scientists have no background in programming. We teach it to ourselves. We mess around a bit. What is version control? Bug tracking? Unit testing? Never heard of it.

But we are supposed to cure cancer and figure out this climate thing. Scientists should be educated in programming and the activities around it. This is not easy to do, but we are working on it. In Canada there are a few guys that do Software Carpentry. They are coming to the Netherlands. If you are a scientist, please join them. If you have ideas about how to teach people about Python, I would be interested to hear about that. Are you interested in being involved, talk to me.

Not many code from scientists makes it to the community. We should, but we don't. It is the elephant in the room.

Jan-Jaap Driessen - Fanstatic 1.0a

fanstatic takes the pain out of static resources. Your cool web application does a lot of difficult computations and a lot of dumb stuff: serving Javascript and css files.

Fanstatic helps you there, with lots of js.* packages on http://pypi.python.org. You can do your version requirements for javascript files in the setup.py of your python package.

You can bundle resources into one. Since last night it has compilation support, so coffeescript, sass, less, clojure, etcetera. Fanstatic saves you time. So if you write sass you no longer need to compile it yourself, as fanstatic does it for you.

You no longer need to think about getting all your javascript dependencies in the html page. You let Python and fanstatic handle it.

Did you see me compile anything during this demo, and bundle those compiled resources, and minify those bundled resources? No! I save so much time and have so much less pain! Fanstatic saves the day.

You may not want to install all the compilers and minifiers on your server and fanstatic can help you there too.

It works with WSGI (fanstatic is the middleware), Zope, flash, Django.

Bundling is a hard topic. It depends on your stack and your setup.

Question: when would you not use fanstatic?

Answer: when I have a lot of time.

We support injection in the html head or at the bottom if your resource can handle that.

There is a branch for loading resources from a content delivery network.

http://www.fanstatic.org/