Simon Willison’s Weblog

Subscribe
Atom feed for python

1,069 items tagged “python”

The Python programming language.

2009

Nose 0.11 released. My favourite Python testing tool just got some really neat new features, including the ability to parallelize tests across multiple processes (hence CPUs) using the multiprocess module, Xunit XML output for integration with continuous integration tools and a --failed switch to re-run only the last batch of failed tests.

# 8th May 2009, 11:24 am / nose, testing, python, multiprocess, xunit, unittest

hash_ring 1.2. A Python library for consistent hashing with memcached, using MD5 and the same algorithm as libketama. Exposes an interface that is identical to regular memcache making this a drop-in replacement.

# 5th May 2009, 1:45 pm / libketama, amir-salihefendic, caching, consistenthashing, django, hashring, md5, memcached, python

djangopeople.net on GitHub. I’ve released the source code for Django People, the geographical community site developed last year by myself and Natalie Downe (it hasn’t otherwise been touched since April last year, so it needs porting to Django 1.1). If you want a new feature on the site, implement it and I’ll see about merging it in.

# 4th May 2009, 6:12 pm / github, git, django, django-people, open-source, projects, python

Right now, pypy compiled with JIT can run the whole CPython test suite without crashing, which means we're done with obvious bugs and the only ones waiting for us are really horrible.

Maciej Fijalkowski

# 1st May 2009, 3:04 pm / pypy, jit, python, jpython, unittests, bugs

django-piston. Promising looking Django mini-framework for creating RESTful APIs, from the bitbucket team. Ticks all of Jacob’s boxes, even including built-in pluggable authentication support with HTTP Basic, Digest and OAuth out of the box.

# 30th April 2009, 7:55 pm / django, rest, restful, python, apis, authentication, oauth, digest, piston, jespernoehr, bitbucket

REST worst practices. Jacob Kaplan-Moss’ thoughts on the characteristics of a well designed Django REST API library, from November 2008.

# 30th April 2009, 7:53 pm / jacob-kaplan-moss, rest, django, python

python-sqlparse (via) Python library for re-identing SQL statements. This could make debugging Django’s generated SQL a whole lot easier. You can try the library out using an App Engine hosted application (complete with an API).

# 28th April 2009, 8:25 pm / python, sql, sqlparse, appengine, django

A Curious Course on Coroutines and Concurrency. David Beazley’s sequel to last year’s mind-expanding “Generator Tricks for System Programmers”, perfect for if you’ve ever puzzled over what exactly you can use Python’s generator-based coroutine support for.

# 24th April 2009, 10:58 am / coroutines, concurrency, generators, python, david-beazley

Finding and fixing memory leaks in Python. Using Dozer, a clever piece of WSGI middleware which displays sparklines of Python object counts and allows you to introspect them, using the gc module under the hood.

# 22nd April 2009, 12:16 pm / amir-salihefendic, python, debugging, memory, memoryleaks, wsgi, middleware

pubsubhubbub. From Brad Fitzpatrick, a simple but clever way of using web hooks (HTTP callbacks) to inform subscribers that an Atom feed has updated in almost real-time—solving the constant polling problem and making it easier for small sites to offer publish-subscribe APIs. Any Atom feed can delegate subscriber updates to a “hub” server. An example hub server implementation is provided running on App Engine.

# 20th April 2009, 6:49 pm / brad-fitzpatrick, pubsub, realtime, atom, pubsubhubbub, appengine, python, webhooks

Phusion Passenger for nginx. Passenger (aka mod_rails / mod_rack) enables easy deployment of Rails and Ruby apps under Apache... and the latest version adds support for nginx as well. It works as an HTTP proxy and process manager, spawning worker processes and forwarding HTTP requests to them via a request queue. It can also handle Python WSGI applications—anyone tried it out for that yet?

# 20th April 2009, 4:53 am / nginx, passenger, python, rails, deployment, apache, ruby

Haystack (via) A brand new modular search plugin for Django, by Daniel Lindsley. The interface is modelled after the Django ORM (complete with declarative classes for defining your search schema) and it ships with backends for both Solr and pure-python Whoosh, with more on the way. Excellent documentation.

# 17th April 2009, 9:53 pm / django, python, search, haystack, whoosh, solr, orm, daniel-lindsley

Paul Buchheit: Make your site faster and cheaper to operate in one easy step. Paul promotes gzip encoding using nginx as a proxy, and mentions that FriendFeed use a “custom, epoll-based python server” as their application server. Does that mean that they’re serving their real-time comet feeds directly from Python?

# 17th April 2009, 5:19 pm / paul-buchheit, python, friendfeed, nginx, comet, epoll, gzip

Drop ACID and think about data. I’ve been very impressed with the quality and speed with which the PyCon 2009 videos have been published. Here’s Bob Ippolito on distributed databases and key/value stores.

# 17th April 2009, 5:13 pm / bobippolito, python, acid, databases, data, pycon, pycon2009

Developing Django apps with zc.buildout. Jacob went ahead and actually documented one of Python’s myriad of packaging options.

# 16th April 2009, 9:50 am / jacob-kaplan-moss, zcbuildout, python, packaging

Visualising Sorting Algorithms. Aldo Cortesi dislikes animations of sorting algorithms, so he designed a beautiful technique for statically visualising them instead (using Python and Cairo to generate the images).

# 14th April 2009, 8:55 am / aldo-cortesi, python, cairo, sorting, algorithms, visualisation

django-shorturls. Jacob took my self-admittedly shonky shorter URL code and turned it in to a proper reusable Django application.

# 13th April 2009, 9:31 am / jacob-kaplan-moss, python, django, revcanonical, djangoshorturls

rev=canonical bookmarklet and designing shorter URLs

I’ve watched the proliferation of URL shortening services over the past year with a certain amount of dismay. I care about the health of the web and try to ensure that URLs I am responsible will last for as long as possible, and I think it’s very unlikely that all of these new services will still be around in twenty years time. Last month I suggested that the Internet Archive start mirroring redirect databases, and last week I was pleased to hear that Archiveteam, a different organisation, had already started crawling.

[... 920 words]

Scaling Django web apps on Apache. Cool to see this kind of article cropping up on IBM developerWorks, but it’s a shame they don’t mention mod_wsgi.

# 10th April 2009, 9:23 am / modwsgi, python, django, ibm, apache

Finding similar items with Amazon Elastic MapReduce, Python, and Hadoop streaming. Tutorial for running Hadoop jobs on Elastic MapReduce using Python and the 2005 Audioscrobbler dataset.

# 7th April 2009, 9:19 am / audioscrobbler, amazon, amazon-web-services, hadoop, mapreduce, elasticmapreduce, python

Rabbits and warrens. Handy tutorial introduction to using RabbitMQ and AMQP with Python.

# 7th April 2009, 9:13 am / message-queues, queues, rabbitmq, amqp, python, tutorial

Automating PowerPoint with Python. Useful tutorial on using ActivePython’s win32com module to automate PowerPoint. The example code pulls in the top 50 banks by assets from the Guardian Data Store and generates a treemap using PowerPoint’s shape drawing primitives.

# 3rd April 2009, 3:13 pm / powerpoint, python, activepython, treemap, guardian, datastore, visualisation

How to use Django with Apache and mod_wsgi. My favourite deployment option is now included in the official Django docs, thanks to Alex Gaynor. I tend to run a stripped down Apache with mod_wsgi behind an nginx proxy, and have nginx serve static files directly. This avoids the need for a completely separate media server (although a separate media domain is still a good idea for better client-side performance).

# 1st April 2009, 12:24 am / django, python, modwsgi, wsgi, nginx, proxy, alex-gaynor, deployment

Apparently [unladen-swallow] is already 30% faster than CPython, and this version is being used to run some of the Python code on YouTube.

Ted Leung

# 30th March 2009, 10:10 am / youtube, python, google, unladenswallow

ProjectPlan—unladen-swallow. A branch of Python 2.6 aiming to radically improve performance (the target is a 5x improvement), by compiling Python to machine code using LLVM’s JIT engine. I think this is a Google 20% time project (or maybe not, see the comments). An early version without LLVM is already available for download.

# 30th March 2009, 10:09 am / google, jit, llvm, performance, python, unladenswallow

Future roadmap for mod_wsgi. mod_wsgi 3.0 isn’t too far off, and will include Python 3.0 support, WSGI application preloading and internal web server redirection (similar to nginx X-Accel-Redirect). Version 4.0 plans a major architectural change that will allow multiple versions of Python to be run from the same Apache.

# 19th March 2009, 5:27 pm / apache, modwsgi, grahamdumpleton, wsgi, python, nginx

Parrot 1.0.0 “Haru Tatsu” Released! Parrot hits 1.0! Anyone know how complete Pynie, the Python implementation on top of Parrot is?

# 19th March 2009, 3:17 pm / parrot, python, pynie

Load spikes and excessive memory usage in mod_python. “The final answer? Stop using mod_python, use mod_wsgi and run it with daemon mode instead. You will save yourself a lot of headaches by doing so.”

# 16th March 2009, 5:26 pm / grahamdumpleton, python, modpython, modwsgi, wsgi, apache

Concurrence. Exciting: a Python framework for “creating massively concurrent network applications” (the tutorial benchmarks a Hello World web server at over 8,000 requests a second). It’s implemented on top of libevent using pyrex, can run on either Stackless Python or Greenlets from the py library and ships with a WSGI server, an HTTP client and a DBAPI 2.0 compliant MySQL driver.

# 15th March 2009, 1:28 pm / python, libevent, pyrex, stacklesspython, greenlets, wsgi, http, mysql

Ruby on Rails 2.3 Release Notes. I’m impressed with how thoroughly Rails has embraced Rack (Ruby’s standardised web framework API, inspired by Python’s WSGI).

# 15th March 2009, 1:22 pm / rack, ruby, rails, python, wsgi