Simon Willison’s Weblog

Subscribe
Atom feed for python

1,085 items tagged “python”

The Python programming language.

2009

Fabric factory. Promising looking continuous integration server written in Django, which uses Fabric scripts to define actions.

# 21st September 2009, 6:35 pm / django, fabric, python, continuous-integration, testing, fabricfactory

Tornado Web Server (via) An extremely exciting addition to the Python web landscape, Tornado is the open sourced version of FriendFeed’s custom web stack. It’s a non-blocking (epoll) Python web server designed for handling thousands of simultaneous connections, perfect for building Comet applications. The web framework is cosmetically similar to web.py or App Engine’s webapp but has decorators for writing asynchronous request handlers. The template language uses Django-style syntax but allows you to use full Python expressions. FriendFeed have benchmarked it handling 8,000 requests a second running as four load-balanced processes on a 4 core server.

# 10th September 2009, 9:32 pm / friendfeed, tornado, python, comet, webpy, webapp, appengine, django, epoll, bret-taylor

Why Python Pickle is Insecure. Because pickle is essentially a stack-based interpreter, so you can put os.system on the stack and use it to execute arbitrary commands.

# 9th September 2009, 11:04 pm / python, pickle, security

Debugging Django in Production Revisited. Eric Holscher expands his show-technical-errors-to-superusers middleware to only show them to users in the group named “Technical Errors”.

# 7th September 2009, 5:21 am / django, debugging, python, middleware, eric-holscher

svnpubsub.py (via) A Twisted/Python powered comet API for pushing out Subversion commits, built for Apache Foundation projects.

# 6th September 2009, 9:50 pm / twisted, python, subversion, svnpubsub, comet

And so it goes, around again. Charles Miller on Java, pointing out that if you don’t have closures and first-class functions you end up having to add band-aid solutions and special case syntactic sugar. Python’s lack of multi-line lambdas leads to a similar (though less pronounced) effect.

# 3rd September 2009, 9:46 am / java, python, charles-miller, programming-languages

Exploring OAuth-Protected APIs. One of the downsides of OAuth is that it makes debugging APIs in your browser much harder. Seth Fitzsimmons’ oauth-proxy solves this by running a Twisted-powered proxy on your local machine which OAuth-signs every request going through it using your consumer key, secret and tokens for that API. Using it with a browsers risks exposing your key and token (but not secret) to sites you accidentally browse to—it would be useful if you could pass a whitelist of API domains as a command line option to the proxy.

# 23rd August 2009, 11:06 am / oauth, apis, proxy, sethfitzsimmons, twisted, python

easy_install no longer working with SourceForge-hosted projects? Unsurprising, since installation software (which is often run as root) that crawls the web and scrapes HTML pages for download links is a horrible, horrible idea.

# 19th August 2009, 11:38 am / easyinstall, python, sourceforge

Kung Fu People (via) The first site to launch based on the open source Django code from djangopeople.net!

# 19th August 2009, 11:37 am / kungfu, django-people, open-source, django, python, peter-bengtsson

How do you install lxml on OS X Leopard without using MacPorts or Fink? I’ve asked on Stack Overflow... hope I get a good answer.

# 14th August 2009, 1:04 pm / python, leopard, lxml, stackoverflow, osx

Python logging from multiple processes. Use Python’s socket log handler to send all log messages to a single server—the python-loggingserver project implements such a server as a Twisted application with a handy web interface for viewing the aggregated logs.

# 13th August 2009, 11:55 pm / python, logging, twisted

Scriptlets—Quick web scripts (via) From the prolific Jeff Lindsay, a pastebin-style tool for short server-side scripts written in Python, JavaScript or PHP that executes them within a Google App Engine powered sandbox. The Java code that implements the service is available on GitHub.

# 13th August 2009, 1:51 pm / github, jeff-lindsay, webhooks, scriptlets, python, javascript, php, googleappengine, appengine, open-source, java

minixsv (via) As far as I can tell, this is the only library that can validate XML using pure Python (no C extension required). I’d be extremely happy if someone would write a pure Python library (or one that only depends on ElementTree, which is included in the standard library) for validating XML against a Relax NG Compact syntax schema. Even DTD validation would be better than nothing!

# 12th August 2009, 4:59 pm / relaxng, elementtree, minixsv, python, validation, xml, xmlschema

topia.termextract. Impressive Python term extraction library (similar to the various term extraction web APIs but you can run it on your own hardware), incorporating a Parts-Of-Speech tagging algorithm.

# 10th August 2009, 9:26 pm / python, topia, termextraction, nlp

Richard Jones: Something I’m working on... Python’s with statement appears to provide just enough syntactic sugar to create some really interesting DSL-style APIs—here’s a very promising example for laying out GUI applications.

# 7th August 2009, 3:47 pm / python, richard-jones, with, gui, dsl

Django: Security updates released. A fix for a directory traversal attack in the Django development server (the one with the big “never run this in production” warnings in the documentation). Also reminds that the release of 1.1 means that 0.96, released over two years ago, has reached end of life and will not receive any further bug fixes after the just-released 0.96.4.

# 29th July 2009, 1:45 pm / django, security, python

Django 1.1 release notes (via) Django 1.1 is out! Congratulations everyone who worked on this, it’s a fantastic release. New features include aggregate support in the ORM, proxy models, deferred fields and some really nice admin improvements. Oh, and the testing framework is now up to 10 times thanks to smart use of transactions.

# 29th July 2009, 9:34 am / django, python, releases, open-source, orm, aggregates

NASA NEBULA Services (via) NASA’s new NEBULA cloud computing platform appears to be built entirely on open source infrastructure, including Python, Django, Fabric, Eucalyptus, RabbitMQ, Trac and Solr.

# 28th July 2009, 12:10 pm / fabric, eucalyptus, nasa, django, open-source, cloud-computing, nebula, python, rabbitmq, solr, trac

Fabric, Django, Git, Apache, mod_wsgi, virtualenv and pip deployment. I’m slowly working my way through this stack at the moment—next stop, fabric.

# 28th July 2009, 11:56 am / fabric, virtualenv, django, python, git, apache, modwsgi, gareth-rushgrove, pip, deployment

xmlwitch. An XML building library for Python that doesn’t suck (I love ElementTree for parsing XML, but I’ve never really liked it for generation). Makes smart use of the with statement.

# 24th July 2009, 12:33 am / withstatement, python, xml, xmlwitch

Django 1.1 release candidate available. If all goes well, the final release will be out next week.

# 22nd July 2009, 12:19 pm / django, releasecandidate, python

Curating conversations. Chris Thorpe has open-sourced the Guardian’s moderated Twitter backchannel app, for displaying back channels at high profile (and hence high potential for abuse) events. It’s a Python application that runs on App Engine.

# 16th July 2009, 7:34 pm / guardian, twitter, chris-thorpe, python, appengine

Tools of the Modern Python Hacker: Virtualenv, Fabric and Pip. Ashamed to say I’m not using any of these yet—for Django projects, my manage.py inserts an “ext” directory at the beginning of the Python path which contains my dependencies for that project.

# 9th July 2009, 11:40 am / python, tools, django, virtualenv, fabric, pip, deployment, pythonpath

Tips on using python’s datetime module. Wow. I’ve run in to problems with datetime and timezones before, but I had no idea how intrinsic those problems were to the design of the library.

# 6th July 2009, 2:20 pm / datetime, python, dates, times

Address Extractor. Running on App Engine, an address extractor web service using code from the EveryBlock open source release.

# 1st July 2009, 8:03 pm / everyblock, python, appengine, addressextractor

EveryBlock source code released. EveryBlock’s Knight Foundation grant required them to release the source code after two years, under the GPL. Lots of neat Django / PostgreSQL / GIS tricks to be found within.

# 1st July 2009, 8:01 pm / gis, postgresql, django, everyblock, python, open-source, gpl

What’s New In Python 3.1. Lots of stuff, but the best bits are an ordered dictionary type (congrats, Armin), a Counter class for counting unique items in an iterable (I do this on an almost daily basis) and a bunch of performance improvements including a rewrite of the Python 3.0 IO system in C.

# 28th June 2009, 3:02 pm / python, python3, python31, performance, releases, armin-ronacher

Towards a Standard for Django Session Messages. I completely agree that Django’s user.message_set (which I helped design) is unfit for purpose, but I don’t think sessions are the right solution for messages sent to users. A signed cookie containing either the full message or a key referencing the message body on the server is a much more generally useful solution as it avoids the need for a round trip to a persistent store entirely.

# 19th June 2009, 9:57 pm / django, sessions, messages, flash, signedcookies, cookies, python

Investigate your MP’s expenses. Launched today, this is the project that has been keeping me ultra-busy for the past week—we’re crowdsourcing the analysis of the 700,000+ scanned MP expenses documents released this morning. It’s the Guardian’s first live Django-powered application, and also the first time we’ve hosted something on EC2.

# 18th June 2009, 11:16 pm / django, ec2, guardian, mpexpenses, projects, python, crowdsourcing