<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>&#964;&#949;&#967;&#957;&#959;&#963;&#959;&#966;&#953;&#945; &#187; Python</title>
	<atom:link href="http://lackoftalent.org/michael/blog/category/development/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://lackoftalent.org/michael/blog</link>
	<description>The occasional rambling of a digital library artisan</description>
	<lastBuildDate>Sun, 13 May 2012 19:17:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Command-line shuffle</title>
		<link>http://lackoftalent.org/michael/blog/2009/09/26/command-line-shuffle/</link>
		<comments>http://lackoftalent.org/michael/blog/2009/09/26/command-line-shuffle/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 20:50:05 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=500</guid>
		<description><![CDATA[Being a nerd, I tend to like the command-line. When I&#039;m working on my laptop at home, I tend to like listening to music. Before I discovered that mplayer had a really convenient shuffle idiom, I would invoke it thusly (to listen to all my Pavement tracks in shuffle mode): export IFS=$'\n' for track in [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:500"><!-- &nbsp; --></abbr>
<p>Being a nerd, I tend to like the command-line.  When I&#039;m working on my laptop at home, I tend to like listening to music.  Before I discovered that <a href="http://en.wikipedia.org/wiki/MPlayer">mplayer</a> had a really convenient shuffle idiom, I would invoke it thusly (to listen to all my Pavement tracks in shuffle mode):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">IFS</span>=$<span style="color: #ff0000;">'\n'</span>
<span style="color: #000000; font-weight: bold;">for</span> track <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>upnp<span style="color: #000000; font-weight: bold;">/</span>MediaTomb<span style="color: #000000; font-weight: bold;">/</span>Audio<span style="color: #000000; font-weight: bold;">/</span>Artists<span style="color: #000000; font-weight: bold;">/</span>Pavement <span style="color: #660033;">-name</span> \<span style="color: #000000; font-weight: bold;">*</span>.mp3 <span style="color: #000000; font-weight: bold;">|</span> ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>shuffle.py<span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">mplayer</span> <span style="color: #007800;">$track</span>; <span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>And the wee shuffle script I whipped together looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #808080; font-style: italic;"># shuffle.py</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">random</span>
&nbsp;
args = <span style="color: #008000;">list</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">stdin</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">random</span>.<span style="color: black;">shuffle</span><span style="color: black;">&#40;</span>args<span style="color: black;">&#41;</span>
<span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>.<span style="color: black;">writelines</span><span style="color: black;">&#40;</span>args<span style="color: black;">&#41;</span></pre></div></div>

<p>And here&#039;s the convenient shuffle idiom that renders my arg-shuffling script somewhat useless:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>upnp<span style="color: #000000; font-weight: bold;">/</span>MediaTomb<span style="color: #000000; font-weight: bold;">/</span>Audio<span style="color: #000000; font-weight: bold;">/</span>Artists<span style="color: #000000; font-weight: bold;">/</span>Pavement <span style="color: #660033;">-name</span> \<span style="color: #000000; font-weight: bold;">*</span>.mp3 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">mplayer</span> <span style="color: #660033;">-playlist</span> - <span style="color: #660033;">-shuffle</span> <span style="color: #660033;">-loop</span> <span style="color: #000000;">0</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2009/09/26/command-line-shuffle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Validating ORE from the Command-line</title>
		<link>http://lackoftalent.org/michael/blog/2009/07/31/validating-ore-from-the-command-line/</link>
		<comments>http://lackoftalent.org/michael/blog/2009/07/31/validating-ore-from-the-command-line/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 18:52:54 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linked Data]]></category>
		<category><![CDATA[OAI-ORE]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Semantic Web]]></category>
		<category><![CDATA[World Digital Library]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=440</guid>
		<description><![CDATA[I&#039;ve been periodically poking at getting Linked Data/RDF views hooked into the World Digital Library web application, following Ed Summers&#039; lead from his work on Chronicling America. The RDF views also use the OAI-ORE vocabulary to express aggregations &#8212; in WDL, an item is an aggregation of its constituent files. The goal is to provide [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:440"><!-- &nbsp; --></abbr>
<p>I&#039;ve been periodically poking at getting <a href="http://linkeddata.org/">Linked Data</a>/RDF views hooked into the <a href="http://www.wdl.org/">World Digital Library</a> web application, following <a href="http://inkdroid.org/journal/">Ed Summers</a>&#039; <a href="http://lists.w3.org/Archives/Public/public-lod/2009May/0301.html">lead</a> from his work on <a href="http://chroniclingamerica.loc.gov/">Chronicling America</a>.  The RDF views also use the <a href="http://www.openarchives.org/ore/">OAI-ORE</a> vocabulary to express aggregations &#8212; in WDL, an item is an aggregation of its constituent files.  The goal is to provide a semantically rich and holistic representation of a WDL item (identifier, constituent files, metadata, translations, and so on). </p>
<p>The ORE format is a new one for me so it&#039;s hard to say whether the output of my dev branch is valid ORE or not.  Plus I&#039;m a sucker for validators.  Turns out <a href="http://www.csc.liv.ac.uk/~azaroth/">Rob Sanderson</a> has developed a <a href="http://code.google.com/p/foresite-toolkit/">Python library for validating ORE</a>, and this little snippet is what I&#039;ve been using to validate the ORE.  I didn&#039;t put much effort into making it readable, so much as banging something functional out so I can meet deadlines, so mea culpa and all that.  But without further hemming and hawing, the code:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># validate.py</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">from</span> foresite <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span>
&nbsp;
rem = RdfLibParser<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">parse</span><span style="color: black;">&#40;</span>ReMDocument<span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
aggr = rem.<span style="color: black;">aggregation</span>
n3 = RdfLibSerializer<span style="color: black;">&#40;</span><span style="color: #483d8b;">'n3'</span><span style="color: black;">&#41;</span>
rem2 = aggr.<span style="color: black;">register_serialization</span><span style="color: black;">&#40;</span>n3<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> rem2.<span style="color: black;">get_serialization</span><span style="color: black;">&#40;</span>n3<span style="color: black;">&#41;</span>.<span style="color: black;">data</span></pre></div></div>

<p>Most of this code is naively copied and pasted from Rob&#039;s excellent <a href="http://code.google.com/p/foresite-toolkit/wiki/PythonLibrary">Foresite documentation</a>.</p>
<p>I invoke it thusly: <code>python validate.py {URL}</code></p>
<p>And the output:</p>

<div class="wp_syntax"><div class="code"><pre class="n3" style="font-family:monospace;">@prefix _27: &lt;http://www.semanticdesktop.org/ontologies/nfo#&gt;.
@prefix _28: &lt;http://localhost/en/item/1/id#&gt;.
@prefix _29: &lt;http://localhost/en/item/1/&gt;.
@prefix bibo: &lt;http://purl.org/ontology/bibo/&gt;.
@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt;.
@prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
@prefix ore: &lt;http://www.openarchives.org/ore/terms/&gt;.
@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;.
@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;.
@prefix rdfs1: &lt;http://www.w3.org/2001/01/rdf-schema#&gt;.
&nbsp;
 _28:ResourceMap a ore:ResourceMap;
     dc:format &quot;text/rdf+n3&quot;;
     dcterms:created &quot;2009-07-31T14:23:31Z&quot;;
     dcterms:modified &quot;2009-07-31T14:23:31Z&quot;;
     ore:describes _29:id. 
&nbsp;
 _29:id a bibo:Image,
         ore:Aggregation;
     dcterms:DDC &quot;973&quot;;
     dcterms:alternative &quot;Antietam, Maryland. Allan Pinkerton, President Lincoln, and Major General John A. McClernand&quot;@en;
     dcterms:created &quot;1862å¹´10æœˆ3æ—¥&quot;@zh,
         &quot;3 de octubre de 1862&quot;@es,
         &quot;3 de outubro de 1862&quot;@pt,
         &quot;3 octobre 1862&quot;@fr,
         &quot;3 Ð¾ÐºÑ‚ÑÐ±Ñ€Ñ 1862 Ð³Ð¾Ð´Ð°&quot;@ru,
         &quot;October 3, 1862&quot;@en,
         &quot;Â Ù£ Ø¢ÙƒØªÙˆØ¨Ø±ØŒ Ù¡Ù¨Ù¦Ù¢&quot;@ar;
     dcterms:creator &quot;Gardner, Alexander&quot;@en,
         &quot;Gardner, Alexander&quot;@es,
         &quot;Gardner, Alexander&quot;@fr,
         &quot;Gardner, Alexander&quot;@pt,
         &quot;Ð“Ð°Ñ€Ð´Ð½ÐµÑ€, ÐÐ»ÐµÐºÑÐ°Ð½Ð´Ñ€&quot;@ru,
         &quot;Ø¬Ø§Ø±Ø¯Ù†Ø±, Ø£Ù„ÙŠÙƒØ³Ù†Ø¯Ø±&quot;@ar,
         &quot;åŠ å¾·çº³, äºšåŽ†å±±å¤§&quot;@zh;
... (and so on and so forth)
     dcterms:title &quot;Antietam, Maryland. Allan Pinkerton, President Lincoln, and Major General John A. McClernand: Another View&quot;@en,
         &quot;Antietam, Maryland. Allan Pinkerton, el Presidente Lincoln y el GeneralÂ Principal John A. McClernand: Otra visiÃ³n&quot;@es,
         &quot;Antietam, Maryland. Allan Pinkerton, le prÃ©sident Lincoln et le gÃ©nÃ©ral-major John A. McClernand: Autre vue&quot;@fr,
         &quot;Antietam, Maryland. Allan Pinkerton, Â Presidente Lincoln e Major-General John A. McClernand: Outra Vista&quot;@pt,
         &quot;ÐÐ½Ñ‚Ð¸Ñ‚ÑÐ¼, ÑˆÑ‚Ð°Ñ‚ ÐœÑÑ€Ð¸Ð»ÐµÐ½Ð´. ÐÐ»Ð»Ð°Ð½ ÐŸÐ¸Ð½ÐºÐµÑ€Ñ‚Ð¾Ð½, Ð¿Ñ€ÐµÐ·Ð¸Ð´ÐµÐ½Ñ‚ Ð›Ð¸Ð½ÐºÐ¾Ð»ÑŒÐ½ Ð¸ Ð³ÐµÐ½ÐµÑ€Ð°Ð»-Ð¼Ð°Ð¹Ð¾Ñ€ Ð”Ð¶Ð¾Ð½ Ð. ÐœÐ°ÐºÐºÐ»ÐµÑ€Ð½Ð°Ð½Ð´: Ð”Ñ€ÑƒÐ³Ð¾Ð¹ ÑÐ½Ð¸Ð¼Ð¾Ðº&quot;@ru,
         &quot;Ø£Ù†ØªÙŠÙ†Ø§Ù…ØŒ Ù…ÙŠØ±ÙŠÙ„Ø§Ù†Ø¯ Ø£Ù„Ø§Ù† Ø¨ÙŠÙ†ÙƒØ±ØªÙˆÙ†ØŒ Ø§Ù„Ø±Ø¦ÙŠØ³ Ù„ÙŠÙ†ÙƒÙˆÙ„Ù†ØŒ ÙˆØ§Ù„Ù„ÙˆØ§Ø¡ Ø¬ÙˆÙ† Ø£. Ù…Ø§ÙƒÙ„ÙŠØ±Ù†Ø§Ù†Ø¯: Ù…Ù†Ø¸Ø± Ø¢Ø®Ø±&quot;@ar,
         &quot;å®‰è’‚ç‰¹å§†ï¼Œé©¬é‡Œå…°å·ž è‰¾ä¼¦Â·å¹³å…‹é¡¿ã€æž—è‚¯æ€»ç»Ÿå’Œå°‘å°†çº¦ç¿°Â·A Â·é©¬å…‹å…‹æ‹‰å—: å¦ä¸€ä¸ªè§†è§’&quot;@zh;
     ore:aggregates &lt;http://localhost/static/c/1/reference/04326u_thumb_item.gif&gt;,
         &lt;http://localhost/static/c/1/service/04326u.tif&gt;;
     ore:isDescribedBy &lt;http://localhost/en/item/1/item.rdf&gt;;
     rdfs:seeAlso &lt;http://hdl.loc.gov/loc.wdl/dlc.1&gt;. 
&nbsp;
 &lt;http://localhost/static/c/1/reference/04326u_thumb_item.gif&gt; a _27:FileDataObject;
     dcterms:format &quot;image/gif&quot;;
     _27:fileSize &quot;34531&quot;^^&lt;http://www.w3.org/2001/XMLSchema#long&gt;. 
&nbsp;
 &lt;http://localhost/static/c/1/service/04326u.tif&gt; a _27:FileDataObject;
     dcterms:format &quot;image/tiff&quot;;
     _27:fileSize &quot;1301614&quot;^^&lt;http://www.w3.org/2001/XMLSchema#long&gt;. 
&nbsp;
 ore:Aggregation rdfs1:isDefinedBy &lt;http://www.openarchives.org/ore/terms/&gt;;
     rdfs1:label &quot;Aggregation&quot;. 
&nbsp;
 ore:ResourceMap rdfs1:isDefinedBy &lt;http://www.openarchives.org/ore/terms/&gt;;
     rdfs1:label &quot;ResourceMap&quot;.</pre></div></div>

<p>You might pick up on some warts I have yet to fix, but there you go.</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2009/07/31/validating-ore-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WDL metadata mapping, and, parsing TEI in Python</title>
		<link>http://lackoftalent.org/michael/blog/2009/07/13/wdl-metadata-mapping-and-parsing-tei-in-python/</link>
		<comments>http://lackoftalent.org/michael/blog/2009/07/13/wdl-metadata-mapping-and-parsing-tei-in-python/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 22:27:46 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Cataloging and Metadata]]></category>
		<category><![CDATA[Metadata Evaluation Toolkit]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[World Digital Library]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=430</guid>
		<description><![CDATA[Context Early on in the effort to develop the first public version of the World Digital Library web application, we developed a (non-public) Django-based cataloging application where Library of Congress catalogers could manage metadata for WDL items. Management in this sense includes creation of records, editing of records, versioning of edits, mapping of source records, [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:430"><!-- &nbsp; --></abbr>
<h2>Context</h2>
<p>Early on in the effort to develop the first public version of the World Digital Library <a href="http://www.wdl.org/">web application</a>, we developed a (non-public) Django-based cataloging application where Library of Congress catalogers could manage metadata for WDL items.  Management in this sense includes creation of records, editing of records, versioning of edits, mapping of source records, and some light workflow for assignment of records to individual catalogers and for hooking into translation processes[<a href="http://lackoftalent.org/michael/blog/2009/07/13/wdl-metadata-mapping-and-parsing-tei-in-python/#footnote_0_430" id="identifier_0_430" class="footnote-link footnote-identifier-link" title="Catalogers cataloged stuff in the English language, but every metadata record needed to be translated into the other six U.N. languages: Spanish, Russian, French, Arabic, Chinese, and Portuguese.">1</a>].  </p>
<p>I worked primarily on the source record mapping tools.  They take a number of formats as input and are called by the cataloging application to map metadata from these formats into the WDL domain model.  Several though not all of which are XML-based, and thus easily dealt with in Python, via the <a href="http://codespeak.net/lxml/api.html">etree module in the lxml package</a>.  </p>
<p><a href="http://onebiglibrary.net/">Dan</a> recently kicked off a new R&#038;D project for evaluating (any) metadata against any number of metadata profiles, mapping into a generic data dictionary, the goal being to determine how feasible it would be to develop a toolset for aiding remediation of metadata across any number of digital collections.  I have been working on this project with Dan, and got started by seeing how generalizable the WDL metadata mapping tools are.  Turns out they&#039;re fairly generalizable once you tweak the various format-specific mapping rules to map into the generic data dictionary model rather than the WDL model (around 15 elements, and somewhere between Dublin Core and MODS in terms of specificity but flatly structured like DC).</p>
<p>Some of the test data I am working with now, that has nothing to do with WDL, is SGML-based <a href="http://quod.lib.umich.edu/t/tei/">TEI 2</a> markup.  The closest I worked with on WDL was <a href="http://www.tei-c.org/release/doc/tei-p5-doc/html/MS.html">TEI P5 for manuscript description</a> which is serialized in XML.  Turns out my TEI mapping rules from before blew up on this TEI 2 stuff, as lxml.etree (naturally) wasn&#039;t digging the non-XML input.  I googled around a bit for how best to parse TEI (or any SGML) in Python and then discovered it&#039;s actually simple as pie.</p>
<h2>Code</h2>
<p>If you&#039;ve got the <a href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> module installed[<a href="http://lackoftalent.org/michael/blog/2009/07/13/wdl-metadata-mapping-and-parsing-tei-in-python/#footnote_1_430" id="identifier_1_430" class="footnote-link footnote-identifier-link" title="And you are but one sudo easy_install BeautifulSoup away from that.">2</a>]:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">from</span> BeautifulSoup <span style="color: #ff7700;font-weight:bold;">import</span> BeautifulSoup
<span style="color: #66cc66;">&gt;&gt;&gt;</span> tei = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'foo.sgm'</span><span style="color: black;">&#41;</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> BeautifulSoup<span style="color: black;">&#40;</span>tei<span style="color: black;">&#41;</span>.<span style="color: black;">findAll</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'title'</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>.<span style="color: #dc143c;">string</span>
u<span style="color: #483d8b;">'[Memorandum to Dr. Botkin]: a machine readable transcription.'</span></pre></div></div>

<p>If not, the <a href="http://codespeak.net/lxml/lxmlhtml.html">lxml.html</a> module works too:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">from</span> lxml <span style="color: #ff7700;font-weight:bold;">import</span> html
<span style="color: #66cc66;">&gt;&gt;&gt;</span> h = html.<span style="color: black;">parse</span><span style="color: black;">&#40;</span><span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'foo.sgm'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> h.<span style="color: black;">xpath</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'//title'</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>.<span style="color: black;">text</span>
<span style="color: #483d8b;">'[Memorandum to Dr. Botkin]: a machine readable transcription.'</span></pre></div></div>

<h2>Data</h2>
<p>And here&#039;s what the sample data looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt;!doctype tei2 public <span style="color: #ff0000;">&quot;-//Library of Congress - Historical Collections (American Memory)//DTD ammem.dtd//EN&quot;</span> </span>
<span style="color: #009900;"><span style="color: #66cc66;">&#91;</span></span>
<span style="color: #009900;">&lt;!entity % images system <span style="color: #ff0000;">&quot;07010101.ent&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> %images;
]&gt;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tei2<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;teiheader</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">date.created</span>=<span style="color: #ff0000;">&quot;1994/03/15&quot;</span> <span style="color: #000066;">date.updated</span>=<span style="color: #ff0000;">&quot;2002/04/05&quot;</span> <span style="color: #000066;">status</span>=<span style="color: #ff0000;">&quot;updated&quot;</span> <span style="color: #000066;">creator</span>=<span style="color: #ff0000;">&quot;National Digital Library Program</span>
<span style="color: #009900;">, Library of Congress&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filedesc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;titlestmt<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;amid</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;aggitemid&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>wpa0-07010101<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/amid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>[Memorandum to Dr. Botkin]: a machine readable transcription.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;amcol<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;amcolname<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Life Histories from the Folklore Project, WPA Federal Writers<span style="color: #ddbb00;">&amp;apos;</span> Project, 1936-1940; American Memory, Library of Congress.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/amcolname<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;amcolid</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;aggid&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/amcolid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/amcol<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;respstmt<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Selected and converted.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>American Memory, Library of Congress.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/respstmt<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/titlestmt<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;publicationstmt<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Washington, DC, 1994.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Preceding element provides place and date of transcription only.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>For more information about this text and this American Memory collection, refer to accompanying matter.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/publicationstmt<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sourcedesc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lccn<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/lccn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sourcecol<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>U.S. Work Projects Administration, Federal Writers<span style="color: #ddbb00;">&amp;apos;</span> Project (Folklore Project, Life Histories, 1936-39); Manuscript Division, Library of Congress.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sourcecol<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copyright<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Copyright status not determined; refer to accompanying matter.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copyright<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/sourcedesc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filedesc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;encodingdesc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;projectdesc<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>The National Digital Library Program at the Library of Congress makes digitized historical materials available for education and scholarship.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/projectdesc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;editorialdecl<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>This transcription is intended to have an accuracy of 99.95 percent or greater and is not intended to reproduce the appearance of the original work.  The accompanying images provide a facsimile of this work and represent the appearance of the original.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/editorialdecl<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;encodingdate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1994/03/15<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/encodingdate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;revdate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2002/04/05<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/revdate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/encodingdesc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/teiheader<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;text</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;manuscript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pageinfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;controlpgno</span> <span style="color: #000066;">entity</span>=<span style="color: #ff0000;">&quot;I07010101&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>0001<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/controlpgno<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;printpgno<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/printpgno<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/pageinfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Memorandum to Dr. Botkin from G. B. Roberts, May 26, 1941<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Subject:  Alabama Material<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>This material has not yet been accessioned and has only 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;del</span> <span style="color: #000066;">rend</span>=<span style="color: #ff0000;">&quot;overstrike&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>beeen<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/del<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> been roughly classified as life histories, folklore, and miscellaneous data and copy save in the case of the 2 ex-slave items and the essay on Jesse Owens, each of which was recommended.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Total no. of items recommended:  3 (14 pp.) 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;handwritten<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>In progress<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/handwritten<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/text<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/tei2<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h5>Notes</h5><ol class="footnotes"><li id="footnote_0_430" class="footnote">Catalogers cataloged stuff in the English language, but every metadata record needed to be translated into the other six U.N. languages: Spanish, Russian, French, Arabic, Chinese, and Portuguese.</li><li id="footnote_1_430" class="footnote">And you are but one <code>sudo easy_install BeautifulSoup</code> away from that.</li></ol><br/>
<hr/>]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2009/07/13/wdl-metadata-mapping-and-parsing-tei-in-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JSON and the Blarghonauts, or, Firefox and Pretty-Printing FAIL</title>
		<link>http://lackoftalent.org/michael/blog/2008/12/02/json-and-the-blarghonauts-or-firefox-and-pretty-printing-fail/</link>
		<comments>http://lackoftalent.org/michael/blog/2008/12/02/json-and-the-blarghonauts-or-firefox-and-pretty-printing-fail/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 21:25:41 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSONovich]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=196</guid>
		<description><![CDATA[There must be a better way of viewing pretty-printed JSON from Firefox than this. (EDIT: Hail, JSONovich!) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 #!/usr/bin/env python # ~/bin/jsonhandler.py # [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:196"><!-- &nbsp; --></abbr>
<p>There must be a better way of viewing pretty-printed JSON from Firefox than this.  (EDIT: Hail, <a href="http://lackoftalent.org/michael/blog/json-in-firefox/">JSONovich</a>!)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #808080; font-style: italic;"># ~/bin/jsonhandler.py </span>
<span style="color: #808080; font-style: italic;"># Take some JSON from a file or stdin, format it, output to a tempfile, </span>
<span style="color: #808080; font-style: italic;"># open in EDITOR</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">__future__</span> <span style="color: #ff7700;font-weight:bold;">import</span> with_statement
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> simplejson
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">tempfile</span>
&nbsp;
EDITOR = <span style="color: #483d8b;">&quot;/usr/bin/gedit&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span> == <span style="color: #ff4500;">2</span>:
        <span style="color: #808080; font-style: italic;"># if invoked as jsonhandler.py {FILE}</span>
        json = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #808080; font-style: italic;"># if JSON is piped in (e.g., from Firefox, </span>
        <span style="color: #808080; font-style: italic;"># or cat {FILE} | jsonhandler.py)</span>
        json = <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdin</span>
    json = simplejson.<span style="color: black;">load</span><span style="color: black;">&#40;</span>json<span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;"># the with_statement is kind of gratuitous but I like it</span>
    <span style="color: #ff7700;font-weight:bold;">with</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">tempfile</span>.<span style="color: black;">mktemp</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'.json'</span><span style="color: black;">&#41;</span>, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">as</span> jsonfile:
        simplejson.<span style="color: black;">dump</span><span style="color: black;">&#40;</span>json, jsonfile, indent=<span style="color: #ff4500;">4</span><span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;"># all of that and gedit doesn't even highlight JSON</span>
    <span style="color: #808080; font-style: italic;"># I have emacs highlighting JSON but this generates a &quot;stdin is not </span>
    <span style="color: #808080; font-style: italic;"># a tty&quot; error, so EDITOR is not set to emacs</span>
    <span style="color: #808080; font-style: italic;"># xemacs works a little better, but I need to click:</span>
    <span style="color: #808080; font-style: italic;"># &quot;Options &gt; Syntax Highlighting &gt; In this buffer&quot; every time, despite </span>
    <span style="color: #808080; font-style: italic;"># saving to custom.el, so EDITOR is not set to xemacs</span>
    <span style="color: #808080; font-style: italic;"># Very annoying!</span>
    <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%s %s&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>EDITOR, jsonfile.<span style="color: black;">name</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>And then I set ~/bin/jsonhandler.py as the action for application/json in Edit | Preferences | Applications.</p>
<p>Yuck.  Help?</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2008/12/02/json-and-the-blarghonauts-or-firefox-and-pretty-printing-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert Windows shortcuts into Ubuntu shortcuts</title>
		<link>http://lackoftalent.org/michael/blog/2008/10/29/convert-windows-shortcuts-into-ubuntu-shortcuts/</link>
		<comments>http://lackoftalent.org/michael/blog/2008/10/29/convert-windows-shortcuts-into-ubuntu-shortcuts/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 23:40:43 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=173</guid>
		<description><![CDATA[[Update: Feel free to grab the code via bzr with bzr branch http://lackoftalent.org/bzr/shortcut_converter.] Here&#039;s another entry in the &#034;dumb little scripts that work for me and may or may not be helpful to other folks&#034; department&#8230; I use both Windows and Ubuntu at home, gradually transitioning from the former to the latter. I&#039;ve accumulated a [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:173"><!-- &nbsp; --></abbr>
<p>[<strong>Update</strong>: Feel free to grab the code via bzr with <code>bzr branch http://lackoftalent.org/bzr/shortcut_converter</code>.]</p>
<p>Here&#039;s another entry in the &#034;dumb little scripts that work for me and may or may not be helpful to other folks&#034; department&#8230;</p>
<p>I use both Windows and Ubuntu at home, gradually transitioning from the former to the latter.  I&#039;ve accumulated a bunch of Windows URL shortcuts, mostly things I wanted to read once so instead of bookmarking them, I dragged their links to my desktop.  This creates .URL files which are simple little plain-text two-liners.  It turns out that on Ubuntu, and probably similar *nix systems, web shortcuts are also simple little plain-text files.  These files have the .desktop extension (though you won&#039;t see the extension by looking at the desktop).  </p>
<p>I wanted a way to convert my .URL files to .desktop files so that I can just toss them on my Ubuntu desktop and double-click them the same way I would if I were on Windows.  This cruddy little Python script does the trick.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #808080; font-style: italic;"># shortcut_converter.py</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">__future__</span> <span style="color: #ff7700;font-weight:bold;">import</span> with_statement 
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
TEMPLATE = <span style="color: #483d8b;">&quot;&quot;&quot;[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=%(basename)s
Type=Link
URL=%(url)s
Icon=gnome-fs-bookmark
&quot;&quot;&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> convert<span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot; Takes a full filepath to a .URL file, converts it to a .desktop file 
        in the same directory &quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Converting %s&quot;</span> <span style="color: #66cc66;">%</span> f
    <span style="color: black;">&#40;</span>filepath, filename<span style="color: black;">&#41;</span> = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span>
    <span style="color: black;">&#40;</span>basename, extension<span style="color: black;">&#41;</span> = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">splitext</span><span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">with</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">as</span> urlfile:
        lines = <span style="color: black;">&#91;</span>line.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> urlfile.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>
    url = lines<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'URL='</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
    dtfname = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>filepath, <span style="color: #483d8b;">'%s.desktop'</span> <span style="color: #66cc66;">%</span> basename<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">with</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>dtfname, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">as</span> dtfile:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Writing %s&quot;</span> <span style="color: #66cc66;">%</span> dtfile.<span style="color: black;">name</span>
        dtfile.<span style="color: black;">write</span><span style="color: black;">&#40;</span>TEMPLATE <span style="color: #66cc66;">%</span> <span style="color: #008000;">locals</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">'__main__'</span>:
    <span style="color: #ff7700;font-weight:bold;">for</span> arg <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>:<span style="color: black;">&#93;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">isfile</span><span style="color: black;">&#40;</span>arg<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">and</span> arg<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">3</span>:<span style="color: black;">&#93;</span>.<span style="color: black;">lower</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">'url'</span>:
            convert<span style="color: black;">&#40;</span>arg<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;*** %s is not a URL file&quot;</span> <span style="color: #66cc66;">%</span> arg</pre></td></tr></table></div>

<p>I used scp to pull over all my .URL files and then invoked the script thusly:</p>
<p><code>python shortcut_converter.py *.URL</code></p>
<p>worksforme!</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2008/10/29/convert-windows-shortcuts-into-ubuntu-shortcuts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Unescaping HTML in Python</title>
		<link>http://lackoftalent.org/michael/blog/2008/08/01/unescaping-html-in-python/</link>
		<comments>http://lackoftalent.org/michael/blog/2008/08/01/unescaping-html-in-python/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 18:56:42 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=140</guid>
		<description><![CDATA[Dear Future Me, You&#039;ve forgotten how to decode (or unescape) HTML or XML in Python again, haven&#039;t you?Â  My, my, that old age does catch up with you. Well, it turns out that ï»¿xml.sax.saxutils.unescape() works like a charm.Â  I&#039;m certain that edge cases lurk here and there, so caveat, um, coder. UPDATE: Edge case found. [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:140"><!-- &nbsp; --></abbr>
<p>Dear Future Me,</p>
<p>You&#039;ve forgotten how to decode (or unescape) HTML or XML in Python again, haven&#039;t you?Â  My, my, that old age does catch up with you.</p>
<p>Well, it turns out that ï»¿<code>xml.sax.saxutils.unescape()</code> works like a charm.Â  I&#039;m certain that edge cases lurk here and there, so caveat, um, coder.</p>
<p>UPDATE: Edge case found.  Note that unescape() will not work on &amp;apos; or &amp;quot;, and so there is:<br /> <code>xml.sax.saxutils.unescape("&lt;p&gt;This is &amp;quot;markup&amp;quot;&lt;/p&gt;", {"&amp;apos;": "'", "&amp;quot;": '"'})</code></p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2008/08/01/unescaping-html-in-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Jython scp</title>
		<link>http://lackoftalent.org/michael/blog/2008/04/17/jython-scp/</link>
		<comments>http://lackoftalent.org/michael/blog/2008/04/17/jython-scp/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 20:08:42 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Transfer]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=124</guid>
		<description><![CDATA[In spite of some open questions, I&#039;ve been making some progress on my Jython-based transport tool. Right now it&#039;s pretty dumb and simple: it copies files to and fro via scp. Being a newb at both Java and Jython made finding the right libraries a bit of a challenge, and so I&#039;m posting some code [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:124"><!-- &nbsp; --></abbr>
<p>In spite of some <a href="http://lackoftalent.org/michael/blog/2008/04/11/jythons-and-javas-and-bears-oh-my/" target="_blank">open questions</a>, I&#039;ve been making some progress on my Jython-based transport tool.  Right now it&#039;s pretty dumb and simple: it copies files to and fro via scp.</p>
<p>Being a newb at both Java and Jython made finding the right libraries a bit of a challenge, and so I&#039;m posting some code here for folks in the same boat.  It&#039;s not particularly pretty due to 1) wanting to get something working very quickly, and 2) weird errors when I try to make things prettier (such as getting rid of the hard-coded bits), but I&#039;ll resolve these soon.<br />
<span id="more-124"></span><br />
The jython code:</p>
<pre name="code" class="python">
# Biter.py
import java
from org.apache.tools.ant import Project
from org.apache.tools.ant.taskdefs.optional import ssh

class Biter(java.lang.Object):
    def __init__(self):
        self.keyfile = '/home/user/.ssh/id_rsa'

    def transport(self, from_uri, to_uri):
        "@sig public void transport(String from_uri, String to_uri)"
        scp = ssh.Scp()
        scp.setKeyfile(self.keyfile)
        scp.setPassphrase('')
        scp.setTrust(True)
        scp.setProject(Project())
        scp.setFile(from_uri)
        scp.setTodir(to_uri)
        scp.execute()
        print "%s -&gt; %s" % (from_uri, to_uri)
</pre>
<p>I set my CLASSPATH to include /usr/share/jython2.2.1/jython.jar, /usr/share/java/jsch-0.1.28.jar, /usr/share/ant/lib/ant-jsch.jar, /usr/share/ant/lib/ant.jar, and &#039;.&#039;, and then compile to bytecode via <code>jythonc -idp gov.loc.repository.transport Biter.py</code>.  Once it&#039;s compiled, I can use the Biter class in Java code thusly:</p>
<pre name="code" class="java">
# BiterClient.java
import gov.loc.repository.transport.Biter;

public class BiterClient {
    public static void main(String[] args) {
        Biter biter = new Biter();
        biter.transport("/home/user/tmp/test1", "user@example.org:tmp/test2");
        biter.transport("user@example.org:tmp/test2", "/home/user/tmp/test3");
    }
}
</pre>
<p>I should note that the passphrase and keyfile are not necessary if you&#039;re passing valid username and password credentials in the remote to_ or from_uri (and the server in question supports password auth).  But pubkey auth is useful for our purposes and that&#039;s why it&#039;s in there.</p>
<p>Hopefully someone somewhere finds this helpful. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2008/04/17/jython-scp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jythons and Javas and bears, oh my!</title>
		<link>http://lackoftalent.org/michael/blog/2008/04/11/jythons-and-javas-and-bears-oh-my/</link>
		<comments>http://lackoftalent.org/michael/blog/2008/04/11/jythons-and-javas-and-bears-oh-my/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 01:41:52 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Digital Libraries and Archives]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Preservation]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Repositories]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Transfer]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=122</guid>
		<description><![CDATA[It&#039;s hard to believe but I&#039;ve been at the new job for six months already, a full half-year come the 29th. Some days it seems like I&#039;ve been here forever; others like I&#039;m still a rank newb. I haven&#039;t written terribly much about what I&#039;ve been up to (but I assure you I&#039;ve been busy). [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:122"><!-- &nbsp; --></abbr>
<p>It&#039;s hard to believe but I&#039;ve been at the <a href="http://lackoftalent.org/michael/blog/2007/09/27/october/" target="_blank">new job</a> for six months already, a full half-year come the 29th.  Some days it seems like I&#039;ve been here forever; others like I&#039;m still a rank newb.   I haven&#039;t written terribly much about what I&#039;ve been up to (but I assure you I&#039;ve been busy).  Let me rectify that.</p>
<h2><strong>The Transfer Problem</strong></h2>
<p>Two of the projects I&#039;ve been working on relate to a fairly general problem that we like to call &#034;transfer,&#034; which revolves around, well, transferring files to and fro.  Sounds simple.  <em>Is</em> simple.  That is, until you start thinking about preservation and accounting for a highly heterogeneous network with idiosyncratic nodes, esoteric storage software, and differential firewall rules.  And that&#039;s where it gets interesting (and problematic). <span id="more-122"></span>The transferring itself, or copying of files from one location to another which we call &#034;transport,&#034; is the easiest part.  We like to use common tools in our environment.  It makes life easy.  And so good ol&#039; <a href="http://en.wikipedia.org/wiki/Secure_copy" target="_blank">scp</a> seems like an obvious choice to handle the job.</p>
<p>Since preservation is a core aspect of our &#034;repository,&#034; a term which I use loosely, we must build certain other functionalities into the transfer process: validation, verification, inventory, backup, ingest, and so forth.  Every time a file is copied to a non-transient location, we verify the file against a (<a href="http://www.faqs.org/rfcs/rfc3174.html" target="_blank">SHA1</a>) checksum and record an event for auditing purposes.</p>
<h2><strong>Repository Workflows</strong></h2>
<p>Some steps in the transfer process are routine and best handled by machines. Thus we automate them with scripts and code.  Others require human intervention.  This introduces another key aspect of our repository needs: workflows.  No two projects will have the same workflow and yet all will have some steps in common.  We&#039;re using JBoss&#039;s <a href="http://www.jboss.org/jbossjbpm/" target="_blank">jBPM</a> library for workflow management and it is more than capable of handling our workflow needs.  It allows us to model complex and varied flows in a robust and not <em>ad hoc</em> way; it does seem preferable to me to model our workflows via jBPM&#039;s graphical editor (serialized to <a href="http://docs.jboss.com/jbpm/v3/userguide/jpdl.html" target="_blank">JPDL</a> XML) rather than copying around blocks of code and otherwise modeling the workflow procedurally in business logic.</p>
<p>One of my coworkers (<a href="http://www.dlib.org/dlib/july07/littman/07littman.html" target="_blank">the author of this</a>) designed a complete workflow system in jBPM last summer and I&#039;ve taken on implementing, tweaking, and testing this system, which has required bootstrapping my sorry-arse Java skills and learning jBPM.  Though I find it difficult to think in Java patterns and generally find it a burdensome environment, I&#039;m quite impressed by jBPM.  I&#039;ve been working on various updates of and unit test coverage for the workflow system, which has been a crash course in a number of Java technologies and a perfect first task at LC, as it gets me into the guts of things.  The Java stack we use for our workflow is highly abstracted and componentized, which is conveniently modular&#8230; but it&#039;s also Java: fairly heavy and arguably not as agile as dynamic languages such as Python.</p>
<h2><strong>Two Great Tastes?</strong></h2>
<p>So recently we&#039;ve begun to think about implementing some transfer and workflow components in <a href="http://www.jython.org/" target="_blank">Jython</a> (Python written in Java).  Why?  The value of Jython is as follows:</p>
<ol>
<li><strong>Ease of deployment</strong> &#8211; Deploying jar files to existing JVMs in production environments (which we do not control) is a simple task, or at least simpler than some other options.</li>
<li><strong>Interoperability</strong> &#8211; Our stack is primarily Java-based and so interoperating with existing Java components means not having to rewrite functionality in other languages.  Jython allows Python to talk to Java and vice versa.</li>
<li><strong>Familiarity</strong> &#8211; It&#039;s Python, and we like Python.  It&#039;s the closest my team has to a <em>lingua franca</em> and so it increases the chances of sharing code, maintaining code, and so forth.</li>
</ol>
<p>It does not come without its drawbacks:</p>
<ol>
<li><strong>Currency</strong> &#8211; The Jython project went moribund for a few years or so and the latest stable version is now 2.2.1.  Compare that to the latest version of Python: <a href="http://www.python.org/download/releases/2.5.2/" target="_blank">2.5.2</a>.  I don&#039;t begrudge the Jython developers, though.  I&#039;m glad some folks picked the project up, dusted it off, and breathed new life into it.   I am also glad that they&#039;re skipping 2.3 and 2.4 releases and plowing right into a 2.5 release.  Because of this currency issue, some Python libraries won&#039;t work with the latest Jython and that means you&#039;re stuck looking for outdated, potentially vulnerable Python libraries, or hooking into Java libraries for the same functionality (which inevitably means more lines of code).  I&#039;m no lines of code fetishist but it does militate against the goal of agility somewhat.One does have the option of living on the edge and trying out the 2.5 branch, but that seems out of step with an infrastructure that is supposed to preserve terabytes upon terabytes of our nation&#039;s, and the world&#039;s, intellectual property.  It&#039;s a responsibility I do not take lightly, as much as I&#039;d like to be on the bleeding edge.</li>
<li><strong>Interoperability difficulties &#8211; </strong>Talking to Java from Jython is a snap: just <code>import java</code> at the top of your script, and, assuming your classpath is copacetic, <em>voila:</em> you have access to Java libraries in your Python code!  Talking to your Jython modules from Java code is, well, a little more complicated. Read on.</li>
</ol>
<p>Despite the caveats it does seem a sane, reasonable, and potentially productive path to go down. Right?  I am specifically looking to implement two workflow components in Jython: one for transport (wrapping Ant&#039;s<a href="http://www.jcraft.com/jsch/" target="_blank"> JSch</a> library, which provides a slick scp API) and the other for automation of <a href="http://www.opensolaris.org/os/community/zfs/" target="_blank">ZFS</a> filesystem/volume creation on the staging server.  Nothing arcane, nothing tricky, nothing fancy.  So it must be easy!  Right? &#8230;</p>
<h2><strong>Lessons Learned?</strong></h2>
<p>I&#039;m beginning to wonder about the feasibility of using Jython to make bits of our Java stack more agile. Specifically, there are three ways to get at Jython code from Java:</p>
<ol>
<li>Compile to bytecode/jar via the Jython compiler (jythonc) and reference your Jython objects and methods as though they were <a href="http://en.wikipedia.org/wiki/POJO" target="_blank">POJOs</a></li>
<li>Embed a Jython interpreter</li>
<li>Instantiate a (<a href="http://jcp.org/en/jsr/detail?id=223" target="_blank">JSR-223</a>) script engine</li>
</ol>
<p>Option 1 is nice because you get object- and method-level interop.  However, <a href="http://www.jython.org/Project/jythonc.html" target="_blank">jythonc</a> is unsupported and will disappear.  This does not seem sustainable though I might be able to limp along a while.  And there are <a href="http://sourceforge.net/mailarchive/message.php?msg_name=96c4692d0802280853r70e6b74fg71aed3cdd7701cbf%40mail.gmail.com" target="_blank">signs of hope</a>:</p>
<blockquote><p>Though jythonc is going away, all of the capabilities it provides will be present in 2.5 in other forms.  We&#039;re adding functionality to expose Python classes as Java classes using decorators to replace the docstring class creation that jythonc provided, and we&#039;re adding static compilation of proxy classes so regular jython can run in applets and other environments with restrictive classloaders.  We&#039;re definitely doing something about jythonc.</p></blockquote>
<p>That doesn&#039;t help much <em>now</em>, of course, but just because jythonc goes away does not mean my jars will stop working.</p>
<p>The suggested methods for option 2 [<a href="http://wiki.python.org/jython/JythonMonthly/Articles/October2006/3" target="_blank">1</a>, <a href="http://wiki.python.org/jython/JythonMonthly/Articles/September2006/1" target="_blank">2</a>] seem to be more trouble than they&#039;re worth.  If the goal is more agile development for certain components, the reliance upon multiple, separate Java classes &#8212; an interface class and an object factory, in the examples listed &#8212; to get a ten-line Jython script working, this seems suboptimal, both inefficient and not straightforwardly maintainable; it seems, to me and my Java-dumb ways, rather baroque.</p>
<p>Option 3 [<a href="http://wiki.python.org/jython/JythonMonthly/Articles/October2006/1" target="_blank">1</a>, <a href="http://www.jython.org/Project/userguide.html#using-jsr-223" target="_blank">2</a>] is more appealing than option 2 as it does not rely upon these other classes specifically for Jython code.  But the number of lines of Java code that must be wrapped around the Jython to get it working looks like overkill for the drop-dead simple scripts I&#039;m writing &#8212; it might be easier, for instance, to just write the darn things in Java and be done with it.  (Did I just say that?)</p>
<h2><strong>Conclusions</strong></h2>
<p>Options 2 and 3 are similar as both involve embedding Jython code, or referencing files with Jython code, and interpreting the code within Java.  Generally, I worry that either option would obviate the benefit of agile Jython scripting because you wind up wrapping the code in so much Java.  I offer two disclaimers to counter my objections:</p>
<ol>
<li>Cleverer Java coders than myself could, I am almost certain, find ways to build abstractions (or abstractions of abstractions) to eliminate the &#034;lines of code&#034; and &#034;many separate classes per Jython script&#034; issues</li>
<li>The value of Jython in our Java environment increases proportionately with the complexity of the component &#8212; given the overhead, a short Java class seems easier and more straightforward to implement than a short embedded Jython script.  On the other hand, there&#039;s value in embedding a Jython script that&#039;d be an order of magnitude simpler than its Java analog.</li>
</ol>
<p>At least, that&#039;s the state of my head right now re: getting Jython and Java to play nice.  If I make any breakthroughs or give up entirely, I&#039;ll post follow-ups.</p>
<p>I am but a Java philistine and a Jython neophyte, so I remain humbly open-minded.  I would greatly appreciate comments, questions, corrections, smackdowns, sagacious advice, and so on.</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2008/04/11/jythons-and-javas-and-bears-oh-my/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

