Simon Willison’s Weblog

Subscribe
Atom feed for python

1,069 items tagged “python”

The Python programming language.

2009

Load Windows ICO files. Apparently PIL has trouble with the most recent versions of the windows .ico format (Vista now embeds PNG images in them)—this clever function deals with the differences and gives back a PIL Image object.

# 17th January 2009, 9:48 pm / pil, python, vista, windows, ico, images, png

Washington Post Update. Peter Harkins summarises the large number of Django-powered database journalism projects released by the Post since September 2007.

# 16th January 2009, 12:18 pm / peter-harkins, washington-post, django, python, data-journalism

Django now has fast tests. Changeset 9756 switched Django’s TestCase class to running tests inside a transaction and rolling back at the end (instead of doing a full dump and reload). “Ellington’s test suite, which was taking around 1.5-2 hours to run on Postgres, has been reduced to 10 minutes.”

# 16th January 2009, 11:40 am / django, testing, transactions, unittests, python, ellington, eric-holscher

Localbuilder. Gareth Rushgrove’s neat little Python continuous integration tool—it watches a directory for changes, then runs a command when it spots any.

# 14th January 2009, 10:57 pm / gareth-rushgrove, python, continuous-integration, localbuilder, testing

The History of Python (via) “A series of articles on the history of the Python programming language and its community”, being compiled by Guido plus guest authors.

# 14th January 2009, 9:42 am / guido-van-rossum, python, history, programming

The Django Book: Version 2.0 (via) Adrian’s working on a new edition of the Django Book updated to cover version 1.0. As with the first edition, it will be available free online in addition to a published Apress paperback. The first three chapters are now available.

# 9th January 2009, 2:54 pm / adrian-holovaty, django, book, python, apress

Rate limiting with memcached

On Monday, several high profile “celebrity” Twitter accounts started spouting nonsense, the victims of stolen passwords. Wired has the full story—someone ran a dictionary attack against a Twitter staff member, discovered their password and used Twitter’s admin tools to reset the passwords on the accounts they wanted to steal.

[... 910 words]

2008

Represent. Andrei Scheinkman and Derek Willis describe how they built the NYTimes Represent feature using GeoDjango and PostGIS.

# 29th December 2008, 10:10 pm / derek-willis, andrei-scheinkman, new-york-times, django, geodjango, python, postgresql, postgis, gis

pygooglechart. I tried a bunch of Python wrappers for Google Charts and liked this one best.

# 22nd December 2008, 11:43 am / python, google-charts

Represent and GeoDjango. The NYTimes new Represent application is built on GeoDjango.

# 20th December 2008, 9:07 pm / represent, new-york-times, geodjango, derek-willis, django, python

How to install lxml python module on mac os 10.5 (leopard). Instructions that work! Finally, I can find out what all the fuss is about.

# 15th December 2008, 12:05 am / lxml, python, osx, leopard, xml, libxml2

On packaging. James Bennett discusses the problems with setuptools (and ruby gems), and recommends Ian Bicking’s pip as a setuptools replacement.

# 14th December 2008, 4:57 pm / python, setuptools, pip, ian-bicking, james-bennett, ruby, gems

lxml: an underappreciated web scraping library. I just wish I could get the wretched thing to install on OS X Leopard without resorting to MacPorts.

# 11th December 2008, 9:54 am / lxml, macports, python, screenscraping, ian-bicking

I don't think that Python 3.0 is a bad thing. But that it's displayed so prominently on the Python web site, without any kind of warning that it's not going to work with 99% of the Python code out there, scares the hell out of me. People are going to download and install 3.0 by default, and nothing's going to work. They're going to complain, and many are going to simply walk away.

Christopher Lenz

# 6th December 2008, 10 am / christopher-lenz, python, python3

pyquery. “A jQuery-like library for Python”—implemented on top of lxml, providing jQuery style methods for manipulating an HTML or XML document.

# 6th December 2008, 9:53 am / jquery, pyquery, python, lxml, xml

Python 3.0. “We are pleased to announce the release of Python 3.0 (final), a new production-ready release, on December 3rd, 2008.”

# 4th December 2008, 12:38 pm / python, python3, releases

Django 1.0.2 released. An update to last week’s 1.0.1 release, which I failed to link to. 1.0.2 mainly fixes some packaging issues, while 1.0.1 contains “over two hundred fixes to the original Django 1.0 codebase”. The team are holding up the promise to move to a regular release cycle after 1.0.

# 19th November 2008, 8:46 am / django, releases, python

The new Lawrence.com. The world’s best local entertainment website, relaunched on Django 1.0 with an accompanying substantial redesign.

# 18th November 2008, 2:25 pm / lawrence-com, django, python, lawrence, kansas, redesign, design

Secrets of the Django ORM. An undocumented (and unsupported) method of poking a Django QuerySet’s internal query to add group_by and having clauses to a SQL query.

# 8th November 2008, 11:49 pm / django, orm, queryset, sql, having, groupby, python

Python gems of my own (via) Did you know you can pass 128 as a flag to Python’s re.compile() function to spit out a parse tree? I didn’t. re.compile(“pattern”, 128)

# 3rd November 2008, 11:59 am / eric-holscher, python, regex

Beanstalkd / Python Basic Tutorial. How to get up and running quickly with my favourite light-weight queue server. If only it had persistence...

# 20th October 2008, 11:40 pm / beanstalkd, python, parand-tony-darugar, message-queues

What’s New in Python 2.6 (via) Python 2.6 final has been released (the last 2.x version before 3.0). multiprocessing and simplejson (as json) are now in the standard library, any backwards compatible 3.0 features have been added and the official docs are now powered by Sphinx (used by Django 1.0 as well). There’s plenty more.

# 2nd October 2008, 11:47 am / django, python, releases, json, simplejson, multiprocessing, sphinx-docs

simplejson 2.0.1. Python’s simplejson JSON library got a whole lot faster while I wasn’t looking.

# 1st October 2008, 10:55 pm / simplejson, json, python, performance, bobippolito

Reia. The most common complaint I see about Erlang is the syntax. Reia is a Python-style scripting language (with a dash of Ruby) that runs on the Erlang virtual machine. Looks promising.

# 25th September 2008, 6:12 pm / reia, erlang, python, ruby, programming

Decorator to limit request rates to individual views. Neat piece of code for public facing web APIs written in Django. Update: some smart criticisms in the comments.

# 24th September 2008, 1:13 pm / django, decorators, apis, python, rate-limiting

bpgsql. Barry Pederson’s pure Python PostgreSQL client library now ships with a Django backend.

# 23rd September 2008, 11:42 am / python, postgresql, django, barry-pederson, bpgsql

RestView—a class for creating a view that dispatches based on request.method (via) I finally got around to writing up a simple approach I’ve been using for REST-style view functions in Django that dispatch based on request.method.

# 21st September 2008, 8:47 pm / restview, django, python, rest, restful, views, django-snippets

backup_to_s3.py. I wrote Yet Another S3 backup script today. It’s a thin wrapper about boto that doesn’t do anything particularly impressive, but it fits my brain.

# 21st September 2008, 6:51 pm / python, projects, backups, s3, amazon-web-services, sysadmin, boto