python - 25.11.2004 - 5.7.2005

PHP-Serialize for Python

Hurring.com : Code Vault : Python : PHP-Python Serialize : v0.3b is an implementation of the PHP serialize() stuff in Python. Very practical for WordPress: often serialized structures are stored in the options that you can resolve this way - you can write tools that work directly on the database, but are written in Python. The author has done the same for Perl - you can thus push simple data structures back and forth between Python, Perl and PHP.

PEP 342 -- Coroutines via Enhanced Generators

PEP 342 describes simple coroutines for Python. Coroutines are essentially mini-threads with manual control - you can freeze code in the middle and restart it with a new defined value. Thus, coroutines provide the first step towards primitive continuations - the only thing missing would be the ability to copy a coroutine.

Philip J. Eby writes about the implementation of this PEP - which, by the way, is based on Python's generators and iterators.

Come on, folks, finally ensure that generators are copyable and it's done.

FramerD is an object database (ok, a Framestore - but it's something similar) with an integrated DB server, CGI interface, and Scheme scripting language. Ideal for building knowledge databases, as FramerD is optimized for the pointer-heavy structures involved. But also very exciting, as you get a Scheme with server and ODB. I definitely have to play with it, especially since it should also compile on OS X (though it doesn't work for me right now). And it is licensed under GPL. And for the snake charmers among the monkey programmers, there is also an experimental Python library for accessing FramerD...

SPE-OSX comes from the same stable as AquaMacs and is a compilation of Stanis Python Editor - a very comprehensive IDE for Python. Also only available from 10.3.

PythonEggs are like .jar files for Python. Only they are based on ZIP. It's about time that Python applications can be downloaded as a single file with dependency definitions and that the installation of Python applications finally becomes easier.

And for those who don't like or can't use Lisp, perhaps SAJAX - Simple Ajax Toolkit by ModernMethod - XMLHTTPRequest Toolkit for PHP can help, which supports not only PHP but also Io, Lua, Perl, Python, and Ruby.

CherryFlow - Continuations in Python

CherryFlow is a continuation-based framework for Python and CherryPy. With it, you can also build continuation-based web servers in Python. The special feature: CherryFlow uses either Stackless' dumpable generators or StateSaver, a small C extension that allows copying running generators under normal Python. Exactly what I back then was looking for to complete my continuations for Python.

The fate of reduce() in Python 3000

The fate of reduce() in Python 3000 - well, it's probably time for me to switch languages. Because anyone who is so stupid as to cut themselves off from Lisp roots will only manage to rebuild more powerful possibilities with primitive means. Ruby also looks very useful and I'm slowly getting used to the syntax ...

Anonymous functions (lambda in Python, blocks in Ruby or Smalltalk) are far more than just obscure Lisp relics. I have many code snippets that live precisely on the fact that I can pass around anonymous code blocks - ultimately, this is about writing your own program structures. In Smalltalk and similar languages (and to some extent in Ruby) you can use this to extend and develop the language itself - which is one of the strengths of Lisp and its friends (and that's why it's also found in Smalltalk and its friends - the Smalltalk developers had a lot of Lisp know-how).

Languages that castrate themselves at this point and think that iterators and list comprehensions (basically nothing more than loops written in shorthand) are a viable replacement for being able to program your own control structures and your own language tools have become completely uninteresting to me. I don't like language designers who think they are smarter than the later programmer and want to impose a language corset on them.

Aranha server monitor

The freshmeat.net: Aranha server monitor sounds exactly like what I programmed under Servermonitoring. However, I don't use XML-RPC, but SOAP. And I didn't provide it with a XUL interface, but a web interface. And I don't use Perl, but Python. Strange.

surprised face

Mine has been running in the company for ages and faithfully performs its duty in monitoring our server zoo.

Ape can transparently map Python objects in Zope to filesystem objects or PostgreSQL databases. Could be very interesting for work. Can also be used standalone (without Zope).

Ian Bicking compares FileSystemView vs. LocalFS as alternatives to store Zope objects in the file system.

Finding Deep Links in Log Files

I asked Pepino about it recently, so I put my Deep Link Finder Script online. It's a simple Python script. Should run on Python 2.2 and up, possibly even Python 2.1 (but that hasn't been tested). The script is configured in the source code (I've added comments for it) and then simply called with multiple logfiles as parameters. It extracts from Apache Combined Logs which sites deep link to specified file types (configurable, some image types are set by default) and how often. It outputs an HTML fragment that you can add headers and footers to in order to put it online - for example, that's how my Zeitgeist page for deep links is created. The other pages have similarly structured scripts, except they collect search terms and general referrers instead.

I take a look at the deep linker list now and then, and if someone shows up there who deep links quite a lot and isn't an aggregator or news service, they get shown a corresponding replacement image. But really only those sites. It bothers me too when my feed reader suggests I'm an image thief or traffic robber.

Optimization Surprises

In dirtSimple.org: Optimization Surprises, Phillip J. Eby writes about optimizations he made to his implementation of generic functions in Python. I find it fascinating whenever he writes about this project, because generic functions are well-known to me from Common Lisp. However, what's equally fascinating is how he squeezes out half microseconds of performance.

In his case, it actually makes a lot of sense, since it's about central machinery that gets called constantly with generic functions. Minimal performance improvements make a huge difference in tight loops.

Also very interesting is what he discovers about Python's internal mechanisms and what effects, for example, simply the existence of closures in a function has on processes.

Exciting. Absolutely exciting.

Orange Data Mining

Another link for the number crunchers: Orange is a data mining library with Python integration and—at least judging by the screenshots—an interesting GUI.

A first Python example in Frontier is now online. Looks very interesting - I wish someone would build binaries now, because I still don't have XCode due to 10.2. And I'd really like to play around with it...

Subway is a Python implementation of the ideas behind Ruby on Rails. So if you're afraid of hurting yourself on all the sharp and curly brackets in Ruby ...

The Temboz RSS aggregator

The Temboz RSS aggregator is a very nicely made aggregator in Python. It uses the Ultraliberal Feedparser for parsing and can import OPML. I find the interface nicely designed and the administration quite straightforward. And it has some nice features like the two-column layout and the fairly simple integrated filtering capability as well as quite useful feed list sorting options. I'm playing around with it a bit right now - even if that will probably reduce my motivation to write my own aggregator.

MonkeyTyping - The PEAK Developers' Center

MonkeyTyping is Phillip J. Eby's approach to optional static typing in Python. The idea looks very interesting. What always fascinates me about Phillip is his ability to look beyond the horizons of the language - just think of his work on generic functions in Python. Python urgently needs more of these kinds of breakthroughs - some discussions around Python show the first signs of language inbreeding (for example, these almost hateful reactions to mentions of Lisp and Lisp features by some Python advocates).

Second p0st: cElementTree now has a C variant to speed up execution. This makes it a real alternative to other DOM implementations.

dirtSimple.org: CLOS-style Method Combination for Generic Functions

Phillip J. Eby once again proves that every programming language that wants to amount to something is destined to eventually become Common Lisp

I like what he's doing - Python's object system is rather primitive, and generic functions and method combinations in CLOS style are very practical tools for programming. His extended object adaptation in PyProtocols was already interesting, but the quite complete object model based on CLOS is definitely appealing.

I would really wish that Guido van Rossum would give more thought to how he integrates PJE's work into Python than to how he introduces optional static data types.

Aquarium - Web framework with MVC approach in Python - comparable to Rails?

appscript - Use Python as a replacement for AppleScript - full AppleEvent and OSA integration

Impostor - Continuation-based web applications with Python

Revision 8033: /user/arigo/greenlet - Minimalistic threads (tasklets as in Stackless Python) as a normal Python C module

ASPN : Python Cookbook : A meta-class that provides class behavior like Ruby - Class overloading (definition of new methods) with Python in Ruby style

Gus Mueller's Website - Writing VooDooPad Plugins with Python and PyOBJC

recondite: You don't tug on Superman's cape... - Python zur virtuellen Maschine von VisualWorks Smalltalk compilieren

Codewalker for Python - A code walker that can make various modifications to code from lambda expressions (specifically early binding etc.)

Xoltar Python Page - diverse functional extensions to Python - curry, lazy expressions, partial evaluation etc.

Python is a weakly typed language, which as any experienced Python programmer knows has both good and bad points - Traits - optionale Typdeklarationen fĂĽr Attribute in Python

Snurf: a Python-based Blogging System - a nice little blogging system that doesn't require a database

Delayed Execution with Python

The original text has moved to the PyDS weblog. The reason is that I cannot manage the text properly with the new software because the necessary tools are not available here (specifically, source code formatting doesn't work here, and besides the text is too huge - at least when it is saved as XHTML).

Charming Python: Implementing "weightless threads" with Python generators - Very interesting concept on how to build extremely resource-efficient threads in Python using generators - cooperative multitasking in 100% Python

Contracts for Python - Programming by Contract in Python based on descriptive metaclasses

ReportLab - PyRXP - Very fast validating XML parser for Python - built on RXP

GadflyB5: SQL Relational Database in Python - 100% pure Python SQL database

Barebones pure-Python PostgreSQL client - PostgreSQL client in pure Python - no C compiler required, therefore very portable, but also less feature-rich

REgurgitate - Example of how to tokenize Python code and rebuild it

StupidSheet - Another example for tokenize - a small pure-Python spreadsheet

PyX - Python graphics package - Generate 2D and 3D graphics suitable for presentations in Python

Durus - Compact object database for Python - fast, but designed for read-heavy systems

Statement coverage for Python - Primitive code coverage analysis for Python

xmltramp: Make XML documents easily accessible. - small compact XML parser and generator library for Python - nicely integrated into the syntax

RDFLib 2.0.4 Readme - Library for working with RDF in Python

ASPN : Python Cookbook : Spreadsheet - a few ideas for controlled eval in Python

Pyco - Tiny Python Distributions - build small Windows EXEs from Python tools.

Lasso - Souk - Python module for integration of the Liberty Alliance Single Signon Protocol.

Python Packages Index: pyDB2 0.996a - DB/2 API for Python - need that at work

SimpleTAL - standalone TAL and METAL implementation