Date sweep

On more than one occasion I've needed to iterate over all dates between two dates, and although the code and concept are trivial it does normally take up 20 minutes to find the exact classes to use, simply because it is a long time between uses. So here's the snippet, more for my own reference, but it will probably be useful to others too. from datetime import date, timedelta step = timedelta(1) # one day at a time start = date(2005,1,1) end = date.today() d = start while d <= end: print d d = d + step

May 17, 2006 · Nigel Sim

HTML table parser using Python

More on the python front. This is my first cut at extracting HTML tables from webpages, and returning them in arrays, using Python. (Files here) The usage would look something like this: import urllib from table_parser import * f = urllib.urlopen('http://myweb.com/data.html') p = TableParser() p.feed(f.read()) f.close() print p.doc # Get to the data

May 17, 2006 · Nigel Sim

Unified search API

RANDOM THOUGHTWe need a unified search API for all websites, so that we can do federated searches across all related websites.IE, I know my info is in one of 3 places, none of which are indexed by google. Solution: Search interface which can hit all the places at once. I’ve done this by hacking the Plone live search facilityProposal. An XML-RPC or GET request which passes a single search string. Results are returned in RSS format. ...

January 23, 2006 · Nigel Sim

Drupal and digital libraries

A Digital library (DL) is an approach to storing, and cataloguing information in the digital age, and many CMS projects have been attempting to achieve, whether they call them digital libraries or not. However a lot of packages make the integration very disjointed. Lets take an example: A website devoted to building boats. There will be articles, photos, links, files, and forums. ...

December 14, 2005 · Nigel Sim

Internet, on the local scale

I can’t help but think that as the cost of transport continues to rise, the importance of the internet in our everyday lives, and interactions within our local communities will increase. We are increasingly shopping online, chatting online and getting up-to-date online. But this is typically with people far away; or at least outside our neighbourhoods. But, as shipping becomes more expensive that ebay item may not be such good value for money, and perhaps it would be better to use the concentrating power of the internet to shop locally. ...

October 20, 2005 · Nigel Sim