Simon Willison’s Weblog

Subscribe
Atom feed for python

1,085 items tagged “python”

The Python programming language.

2009

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

A few notes on the Guardian Open Platform

This morning we launched the Guardian Open Platform at a well attended event in our new offices in Kings Place. This is one of the main projects I’ve been helping out with since joining the Guardian last year, and it’s fantastic to finally have it out in the open.

[... 839 words]

It’s time for a change. Jacob Kaplan-Moss is joining Revolution Systems, who will now be offering professional Django support “to companies who need a Django expert on staff, but can’t afford someone full-time.”

# 4th March 2009, 10:30 pm / jacob-kaplan-moss, django, python, support

Django snippets: Smart {% if %} template tag. Chris Beaven's drop-in replacement for Django's {% if %} tag that adds comparison operators (less than, greater than, not equal etc) while staying backwards compatible with the less able original. I love it. This is one place where I no longer favour Django's stated philosophy: I think it's perfectly reasonable to use comparisons in presentation logic, and I've found that in my own code the lack of an advanced if tag frequently leads to pure presentation logic sneaking in to my view functions.

# 3rd March 2009, 3:03 pm / django, python, templating, if, chris-beaven

How FriendFeed uses MySQL to store schema-less data. The pain of altering/ adding indexes to tables with 250 million rows was killing their ability to try out new features, so they’ve moved to storing pickled Python objects and manually creating the indexes they need as denormalised two column tables. These can be created and dropped much more easily, and are continually populated by an off-line index building process.

# 27th February 2009, 2:33 pm / mysql, friendfeed, databases, bret-taylor, scaling, sharding, python

django-springsteen and Distributed Search. Will Larson’s Django search library currently just talks to Yahoo! BOSS, but is designed to be extensible for other external search services. Interestingly, it uses threads to fire off several HTTP requests in parallel from within the Django view.

# 25th February 2009, 10:28 pm / django, python, will-larson, djangospringsteen, yahooboss, search, http, threads, concurrency

FAPWS3-0.2 (WSGI server based on libev). Another strong contender for Python’s answer to Mongrel—3500 requests/s for static files, 43 for a simple dynamic (Django powered) pages and 4.8 for a heavy SQL query—all benchmarked with 300 concurrent requests.

# 25th February 2009, 10:21 pm / mongrel, fapws, django, python, webservers, wsgi

The History of Python: Adding Support for User-defined Classes. Guido designed the run-time representation first, and tried to design the syntax to include as few new parsing concepts as possible. The origins of explicit self are also explained.

# 18th February 2009, 11 pm / guido-van-rossum, python, classes

DB2 support for Django is coming. From IBM, under the Apache 2.0 License. I’m not sure if this makes it hard to bundle it with the rest of Django, which uses the BSD license.

# 18th February 2009, 10:58 pm / bsd, open-source, licenses, ibm, db2, django, python, databases, orm, antonio-cangiano

Announcing django-viewtools. A really excellent idea—run ./manage.py viewtools --pdb /path/on/site/ to debug a view in your Django project that is raising an error using the Python debugger, or use --profile to run the full request cycle for that URL through the profiler.

# 17th February 2009, 9:35 pm / django, debugging, eric-moritz, python, profiler, pdb, djangoviewtools

CloudMade: A Summary of the Future of Mapping. CloudMade are now offering commercially supported APIs on top of OpenStreetMap, including geocoding, routing and tile access libraries in Python/Ruby/Java and a very neat theming tool that lets you design your own map styles. This is really going to kick innovation around OpenStreetMap up a notch.

# 17th February 2009, 11:25 am / openstreetmap, cloudmade, mapping, python, ruby, java, geocoding, routing, tiles

Dulwich. A pure Python implementation of the Git file format and protocols. Reinforces my impression that a key to Git’s success is stable, well designed and documented on-disk formats.

# 16th February 2009, 10:27 pm / git, python, dulwich

Write to a Google Spreadsheet from a Python script. I didn’t know Google Spreadsheets could directly serve dynamic images that automatically update when the underlying data changes.

# 16th February 2009, 9:02 pm / googlespreadsheets, google-docs, google, python

Xapian performance comparision with Whoosh. Whoosh appears to be around four times slower than Xapian for indexing and empty cache searches, but Xapian with a full cache blows Whoosh out of the water (5408 searches/second compared to 26.3). Considering how fast Xapian is, that’s still a pretty impressive result for the pure-Python Whoosh.

# 14th February 2009, 1:15 pm / whoosh, xapian, search, full-text-search, python, richard-boulton

pytyrant. A pure-python client library for the Tokyo Tyrant binary protocol (used to access Tokyo Cabinet databases over a network). The library appears to be developed by Bob Ippolito and the team at Mochi Media.

# 14th February 2009, 11:19 am / bobippolito, mochimedia, pytyrant, python, tokyocabinet, tokyotyrant

EuroDjangoCon 2009. Tickets are now on sale for the conference, scheduled for 4th-6th of May (not March as I originally said) in Prague (followed by two days of development sprints).

# 12th February 2009, 4:59 pm / django, djangocon, eurodjangocn, prague, python