Kiwi PyCon 2014 ran this weekend (13-14 September 2014) in Wellington, New Zealand. I went along because it was local, and I have been increasingly dragged into Python tools and coding by using Ryu, Salt, and Ansible.

Kiwi PyCon is two days long (plus a tutorial day before main conference, which I did not go to), and runs two streams for most of the days (the exceptions being a keynote talk each day, and the lightning talks).

I spoke about Ryu first thing (after the keynote) on Saturday, in stream two; the talk was recorded and is available on YouTube. The talk ended up fairly rushed (it turns out 25 minutes really is not much time to introduce a bunch of concepts plus several tools!), but hopefully the main points came across -- and several people said they had liked the talk. The slides and examples are online, and give a pretty complete idea of what was intended to be in the talk.

Beyond my talk, most of what I took away from the conference was a series of (hand scribbled!) notes of various things to investigate later -- many of which came from the excellent set of lightning talks (it turns out if you're well prepared you can get a lot across in 5 minutes!). By way of aide memoire for myself of things to investigate later, and potentially useful references for others):

  • iPython, originally from the scientific Python community, is extremely useful both as a better command line Python interactive enviornment, and also as a "web notebook" for Python embedded in an article, that can be shared. "%cpaste" for executing code pasted in seems particularly helpful.

  • Vagrant came up frequently, for building a VM/environment with particular characteristics -- with people using Ansible, or Puppet or similar to do post-base-OS configuration. (See also Ansible Cluster Setup example.)

  • Docker also came up frequently, to do a similar thing utilising Linux containers. Docker-OSX was recommended over the official Boot2Docker as being easier to use on OS X. (For both I would actually prefer a way to use it that did not involve a second virtual machine environment -- VirtualBox -- on my system competing for resources... given I already have VMWare Fusion installed for other reasons. In theory using VMWare Fusion is possible.) Python's fig module was also suggested to help create a Python environment via Docker.

  • OpenShift is RedHat's PAAS, for hosting web apps; it appears to be a RHEL-based PAAS layer over Amazon AWS (which itself is IAAS). It appears there is a free account level that allows a couple of VMs and might be useful for testing; they have gears/cartridges for various web development frameworks, databases, etc.

  • On Testing:

  • On Packaging and "getting started":

    • pbr (from OpenStack), does a reasonable job of presetting sane defaults for setuptools, versioning (out of git changelogs), etc. In particular the sem-ver: tag on commit meesages allows it to make sensible decisions about the next version that follow Semantic Versioning (always a great idea). From Robert Collins. (Also pbr-semver due to come out with OpenStack 0.11, which handles some special cases, like developer builds/pre-release builds, and distribution patching, better.)

    • With a recent PIP: pip install -r requirements.txt, where the requirements.txt lists all the requirements in a declarative format.

    • Catalyst IT's basil looks like a reasonable "build me a simple, working, Python web framework environment" tool (already supporting several Python web frameworks), and seems useful as a "try this new thing out with minimal effort". (Also leveraging Vagrant, etc.) Currently only tested with Ubuntu Linux though, and described as "about 80% cross platform"....

    • For basic Python web development:

      was suggested as a reasonable basic web framework and deployment choice to start with. (Slides and examples from talk.)

    • The "begins" module was suggested to cut down on boilerplate code required, by using @begin decorator rather than lots of boilerplate. (See also the talk "Command line programs for busy developers".)

      (ETA, 2014-09-15: See also DocOpt, which defines the arguments/options simply for POSIX-style command line argument documentation; available for a bunch of languages, including Python.)

    • pyenv is useful for switching amongst multiple Python environmnts (eg, Python versions installed as well as virtualenvs). (Like rbenv, but for Python instead of Ruby.)

  • Random hacks:

    • You can glue an external MIDI control device to Python using MIDIdings, and then use "xte" to turn that into keystrokes injected into X, and thus control "any" application via MIDI, currently so long as that application is Darktable (a photo editing app). (But in theory extendable to anything with a reasonable scriptable interface.)

    • PyPy.JS is PyPy cross-compiled to asm.js, using Emscripten -- a Javascript backend for LLVM. Like JSMESS (which powers the Internet Archive's "console livingroom", it is a pretty big kludge (eg, PyPy.JS at present needs 15MB+ of JS downloaded to start the Python environment...) -- but it's great proof of concept. (For actually writing web front end code in a Python-like language something like brython or PythonJS (docs) was suggested as much more efficient; they're basically translators, so do not give a complete Python experience.)

    • koordinates seems to have a good selection of NZ GIS data, which can be combined with MapBox's tilemill to create interactive maps. ogr2ogr (from GDAL is useful to convert between GIS formats, eg Shapefiles to GeoJSON; see also GDAL. (MongoDB can natively work with GeoJSON, including various GIS-aware tests such as if a point is in a region.) (Fiona and Shapely were both recommended too. As well as data.govt.nz, and the Open Data Catalogue for New Zealand.)

    • Goto in Python (by Carl Cerecke -- cannot easily find online version), as a Python3 decorator that edits bytecode (CPython only!) -- since the bytecode supports jumps. See also earlier Python2 version, and a 2004-04-01 implementation of Goto in Python, which works via tracing and is much slower, and yet another version as a decorator. (In practice probably only useful if targetting Python as a translation target from some other language that already has goto.)

ETA, 2014-09-19: Additional resources: