Activity tagged “python”
Pylons'/Pyramid's new unit testing guidelines. *Very* good stuff here.
We generally think of languages like Python as high-level languages, but that doesn't mean they're not capable of diving down into low-level territory.
You could teach an advanced Python class by just going over all of Raymond's Python recipes.
Some info and code from Justin Lilly on hooking up a PSHB callback to PyPI.
Everything you ever wanted to know about re-raising exceptions in Python.
A full-screen console (curses) debugger for Python. Looks like a nice middle-ground between pdb/ipdb and a GUI debugger.
Nice technique for lightweight WSGI apps without needing to touch your Apache conf after the initial setup. I'd like to do something like this for my personal site so that it's easier to deploy quick & dirty apps.
Everyone: do this. Now.
Eric's fork of Nathan's flopsy, a simple AMPQlib wrapper.
Really awesome, and I think I finally understand how heapsort works. Oh, and it comes with bonus Python+Cairo examples.
Interesting: “an open source web crawling and screen scraping framework written in Python.”
A good introduction to message queues, specifically RabbitMQ.
An implementation of Erlang-style concurrency for Python. Processes are implemented on top of threads, unfortunately, so there's a pretty low limit on the level of concurrency, which illustrates the problems with “porting” a concept like this between languages. Still the API is relatively sane, and with some work on the underlying model — perhaps a switch to select/epoll — this could be a very nice addition to the Python concurrency toolkit.
zc.buildout, the build isolation system I've been using, has finally grown its own website, with real, actual documentation. Awesome.
A really good summary of what's good about Pylons. I'm glad to see that the recent 0.9.7 release adds “documentation” to the list; all too often, poor or missing documentation cripples an otherwise good chunk of code.
Drop into an interpreter in the middle of your doctest. Brilliant!
Pure-Python search engine. Looks like a great idea if you need something simple and don't want to mess with an external service.
It uses Python 3 or it gets the hose. On a more serious note, James absolutely nails it w.r.t Python 3.
Finally! easy_install staticlxml and done.
A set of zc.buildout recipes that make it *stupidly* easy to configure and set up a buildbot master or slave — it's literally like six shell commands to get a dummy buildbot going. Totally freeking awesome.
A wonderful introduction to making AJAXy sites with Django. Make sure to pay attention to the first step: “the first step to implementing an Ajax webapp is to implement the webapp without Ajax.” Word.
How to integrate Django 1.0's file storage APIs with MogileFS.
I literally laughed so hard I nearly fell out of my chair.
Like those hackish CSS preprocessors that everyone writes when they get pissed about CSS's lack of variables, except actually well-thought-out and basically awesome. I think I'll be using this for my CSS from now on.
Really purty one-page cheat-sheet, updated for Django 1.0.
The schema evolution in Django space is really heating up. With luck we can keep the competition friendly, and pull out a best-of-breed solution to roll back into Django.
A conference management package developed by LCA.
Is Spawning Python's answer to Mongrel?
Wrappers for OpenSSL and LibSSH2.
Fantastic article on building a top-down parser in just a few hundred lines of Python. Read this even if you don't care about parsing: effbot really demonstrates many of the cool idiomatic tricks that makes Python such a pleasure to write and read.
A library for writing fuzz testing programs.
Another database migration tool. This one's not Django-specific (though it will work with Django), but it is PostgreSQL specific. I'm really quite happy with the competition in this space right now; it'll force any eventually Django built-in migration to
“Neat script I wrote for a friend to annotate a Python script with the types observed during a run of the program.”
How to make Python 2.5 the default on Debian Etch
Stack hacking for fun and profit.
The short version: lxml kicks ass.
Some nice notes on how the Sphinx templates are laid out.
“Executive summary: Python 2.6 and 3.0 finals are planned for September 3, 2008.” Woo!!
How to run Django (0.96) on IronPython, including an MSSQL backend.
The folks that made the Django Ts and hats for PyCon, as well as all the great Python gear for sale. Great quality and great people!
haufe.eggserver is a tiny webfront to a local egg/sourcecode archive distribution directory (eggs and other distribution files stored directly on the filesystem).
An exploration of writing a Python/C extension in pure C versus using ctypes. The takeaway is that ctypes is slower, but easier.
“a python tool that figures out the differences between two similar XML files, in the same way the diff utility does” Seems a bit buggy, but might be useful
Two-phase commit proposal for Python. A bit esoteric, but this could help us crazy ORM weenies a bit.
Another iCalendar library. This one has perhaps the best API of all the ones I've used and seems to work with all the iCal feeds I've thrown at it.
A plugin for optparse to do fuzzy dates. Lets your CLI scripts take arguments like “—start today —end tomorrow”; very cute.
“… a bit like a dumbed down Capistrano, except it's in Python, dosn't expect you to be deploying Rails applications, …. Unlike Capistrano, Fabric wants to stay small, light, easy to change and not bound to any specific framework.”
Brett's (preliminary) slides on contributing to Python. I need to prepare something similar for Django.
Neat. I hadn't realized that Hadoop map/reduce jobs could be a bog-standard shell script. It's especially cute that testing the job comes down to “cat data | map | reduce”.
A bit of code from GvR to make monkeypatching look cleaner. Very clever (of course), though I'm not sure how much I like it: I *like* that monkeypatching looks ugly in Python; it makes the monkeypatch code smell more obvious.
Finally, a working readline for Leopard: “easy_install -f http://ipython.scipy.org/dist/ readline”
Marty implements a plugin architecture in six (brilliant) lines of code.
A cool idea: pre-bake static pages generated by Django. Sometimes simple is better.
Cryptography makes my head hurt.
Sounds relatively smart. However, I'd be suspicious of using chroot — I'm told it wasn't especially designed to be a security feature exactly. Were I to do something of this nature, I'd probably use pypy-sandbox.
The Front Range Pythoneers strike again: Django now runs pretty well on Jython. This really is a big deal.
A neat idea: explicitly control which symbols a module exports. It smacks a bit of B&D programming, but could be useful.
Man, OSX ships with all sorts of gems.
The new toolchain for the Python docs. Lots of smart stuff going on in here.
An implementation of tuplespaces in Python
RTF generator written in Python. Looks like a docutils writer based on PyRTF should be pretty trivial, and that might make a better reST -> Word workflow than my current reST -> ODF -> OO.org -> Word nonsense.
XKCD discovers what we've known all along. Let the latest battle in the language wars begin.
Non-blocking IO library by Linden Lab. I've heard awesome things about this; gotta give it a try.
Justin and Travis' presentation on GeoDjango from FOSS4G
All (and there's lots of it) the new stuff in PyObjC 2 (i.e. the version in Leopard). Really, really nice stuff here.
Good thing someone figured this out — without ipython I don't know how I'd get any work done!
Sweetness. Hopefully someone'll use this to work on a DB2 driver for Django.
Python charting package. Yes, it's YA, but this one uses Cairo and looks *nice*.
Nice utility class for dealing with IPv4/IPv6 addresses. Especially nice is the netmask handling; I never have been very good at calculating netmasks by hand.
I never remember how to do this right. Don't miss the comments for Raymon Hettinger's amazingly clever version.
Apparently Jaiku is using Django internally, which means Google's now using Django in yet another place.
Scroll to the bottom for extractkeychain.py, a quick script to dump keychain passwords to plaintext (you *are* piping that into GPG/OpenSSL, right?)
Some important notes about strings in Python 3. There's a subtle but important change from 3a1: the bytes type is now immutable. This is a good change IMO; the net result sounds very sane.
Beautifully simple Django/SQLAlchemy integration layer that automatically maps Django models into SQLAlchemy ORM objects. In theory a similar approch would allow SQLAlchemy objects to be exposed as Django models; that would kick ass.
From the Chandler project, a Python module to parse “natural” datetime constructs (i.e. “tomorrow”, “next monday”, and even “two weeks from last thursday at noon”). The API is shitty and Java-esque, but the functionality is great.
We should support bcrypt in Django if this module is installed.
This looks great. All my Zope knowledge comes from the hairy Zope2 days, so I really need to brush up on the brave new world of Zope.
Interesting work to integrate Django and Babel. Even if you don't need translation, there's some useful date/time/decimal formatting template filters here.
Required reading for working with namespaces and ElementTree. It's not hard, but there are a lot of details to get right.
“Recently I switched all of my websites to Djanog from Rails and you can see the difference.” Wow, an amazing difference in RAM consumption. Especially surprising given that Python/Django isn't exactly known for low memory usage.
Someone order the man some Kleenex; he's gonna need 'em.
Not sure about the quality of the benchmarks, but I'd nevertheless still like to see how Django stacks up here. Not very well I'd imagine, but Django's always been an 80% ORM anyway, so 80% of the performance would be just *fine* with me.
Sweet - someone wrote up the (simple) steps to getting Django running on an iPhone. Now I don't have to!
Erlang-ish pattern matching in Python, from Ian Bicking.
Python-based command-line front-end to Bugzilla.
A nice and simple producer/consumer threadpool utility. Hooray for doing the simplest possible thing.
A tool for parsing C header files and generating ctypes wrappers. From the pyglet project, which includes ctypes wrappers for OpenGL. I'm not sure if this is tunned specially for OpenGL, but if it's roughly generic it could save *lots* of time.
A stab at a memcached-like message queue. Looks super-simple, and 1000 op/s isn't half shabby.
I got frustrated by the etree import dance, so I wrote this.
Frank Liang's hypenation algorithm (i.e. the good one that TeX uses) in Python.
Adrian's “reverse template engine:” take a series of files and construct a template that could have been used to generate those pages. Obviously extremely useful for data scraping.
Antonio on Django/Tabblo: “the HP folks doing diligence on us started by asking why we had not chosen Ruby on Rails and came out the other end incredibly impressed with our Django choice.”
“Game Objects is a collection of 2D and 3D maths classes, and algorithms for helping in the creation of games with Python. Suitable for PyGame, but independent of it.”
TurboGears 2.0 will be built on top of Pylons. This is a very good thing for the Python web community. This has majorly cool implications for Django, too, so I better get my butt in gear and start coding.
“takes an ambiguous xml file and generates the ET code to generate that xml file”
The “official” (well, as official as it gets) version of the Django site.
PyFacebook — Python wrapper for the Facebook API. Uses Django by default.
A book on natural language processing in Python.
A good explanation of the underlying SQL behind polymorphic associations. This is how Django does so-called “generic relations” (through a centralized content-types table instead of the address_associations table here).
This is how Python does additions to the stdlib. We probably should look to do something similar…
For a while now I've been talking up the new things Python 2.5's AST will allow; this is just the tip of a very exciting iceberg.
“Package for using processes which mimics the threading module, and allows the sharing of objects between processes.”
Pure Python LaTeX parsing/processing tools. Neat.
Awesome article on how you can write a simple spelling corrector in a handful of lines of Python.
Holy freaking crap this is cool.
Useful notes on using matplotlib without the pylab interface.
Great writeup of *why* expat can cause mod_python to segfault. The mod_php + mod_python crashes that some Djangonauts see happen for exactly the same reason, so the debugging advice here is useful there, as well.
Continuous integration tool that integrates with Trac. We really should get this set up for Django…
A good collection of stories from Django users. Gives me the warm fuzzies :)
Another Lucene-based web service tool (this one based on Plone)
“Pyglet is a cross-platform gaming / multimedia library written in pure Python.” Built on OpenGL.
These guys have some interesting ideas about Python Packaging.
A tool to review an svn repository with new files/conflicts and quickly decide what to do with them. Pretty nifty.
YA python to API doc tool. But this one's by mwh, so it's likely a cut above.
Ping's page on his voting research. Some hackers hack code, others hack democracy.
Low-level database connectors for MySQL. Essentially you get to use a relational database without SQL. Could be very interesting when combined with an ORM.
An amazing breakdown of the various Python testing tools — there are even more of them then web frameworks!
Treat paths as objects, not strings. Even better than Jason's path.py, and there's even a chance this one'll end up in Python's stdlib.
A document classification algorithm. Wonder if it would be useful for classifying stories…
Python code to convert RelaxNG Compact to the XML syntax.
I need to add something like this to my site.
smtpd.py — if it's good enough for Guido, it's good enough for me.
Matt says this is a better iCal library than the other two I just bookmarked…
“CalCore is an advanced, flexible calendaring component for Python. It allows the Python developer do write advanced calendaring applications either using their own event storage or integrating with external calendar servers.”
A bunch of format tools; itools.csv, itools.ical, …
flashticle is a MIT licensed Python 2.4 library implementing various Macromedia Flash related data formats and protocols. flashticle is sponsored by Mochi Media, LLC.
“Travellers who fly Southwest airlines know all too well the importance of “getting an A” so they can board in the first boarding group… With this script you will never again miss “getting an A” regardless of when your flight is.”
My OSCON session
My OSCON tutorial
Using the Jet engine (MS Access) from Python on Windows
Python Web Framework Statistics
Nabu is a simple framework that extracts chunks of various types of information from documents written in simple text files (written with reStructuredText conventions) and that stores this information (including the document) in a remote database for late
Matt lays down the info
Pythonic RRD bindings — only just getting started, but already quite a bit nicer than the standard bindings.
Video and audio from the Snakes and Rubies event
PySyck is aimed to update the current Python bindings for Syck. The new bindings provide a wrapper for the Syck emitter and give access to YAML representation graphs. Hopefully it will not leak memory as well.
MIT licenses JSON encoder/decoder in Python. Besides the better license, the code is much clearer than json-py
Witness an epic battle of Those WIth Strange Last Names Who Write Web Frameworks
A very good and fair comparison of Django and TurboGears
Python for PSP!
A hook script for SVN that can be used for fine-grained permissions.
I've been looking for something like this!
Deadline is Dec 31st — get your act together, Jacob!
Generate secure values for hidden input fields that can't be tampered with
A quote from Guido van Rossum on commit privileges.
How to work around a PyPI outage.
Porting Ryan Tomayko’s simple prefork network server into Python. You know, because it’s there.
The history and future of Python web development. A talk given at PyCon Argentina and PyCon Brazil, 2009.
Need an experienced Python/Django developer? A good friend of mine needs a new gig.
Python has one package distribution system: source files and setup.py install. And easy_install. Python has two package distribution systems…
The main part of getting Django working on alternate Python VMs was fixing the various assumptions we made about implementation details of Python.
and why you should be, too.
Inspired by Titus (who was in turn inspired by brian d foy), here’s what I hate about Python. I completely agree with Brian that you can’t trust any advocate who doesn’t know enough to find stuff to hate. Given that I spend a lot of time advocating Python, writing down what I hate seems a good exercise.