@@ -0,0 +1,1288 @@
+#! /usr/bin/env python%0A%0Afrom BeautifulSoup import BeautifulStoneSoup%0Afrom codecs import open%0Aimport os%0Aimport argparse%0A%0Adef wp2html(xml):%0A    xmlfile = open(xml, encoding='utf-8').read()%0A    soup = BeautifulStoneSoup(xmlfile)%0A    items = soup.rss.channel.findAll('item')%0A%0A    for item in items:%0A        if item.fetch('wp:status')%5B0%5D.contents%5B0%5D == %22publish%22:%0A            title = item.title.contents%5B0%5D%0A            content = item.fetch('content:encoded')%5B0%5D.contents%5B0%5D%0A            filename = item.fetch('wp:post_name')%5B0%5D.contents%5B0%5D%0A            yield (title, content, filename)%0A%0Aif __name__ == '__main__':%0A    parser = argparse.ArgumentParser(description=%22%22%22Transform a wordpress xml export into rst files %22%22%22)%0A%0A    parser.add_argument(dest='xml', help='The xml filepath')%0A    parser.add_argument('-o', '--output', dest='output', default='output', help='Output path')%0A    args = parser.parse_args() %0A%0A    for title, content, filename in wp2html(args.xml): %0A        html_filename = os.path.join(args.output, filename+'.html')%0A        rst_filename = os.path.join(args.output, filename+'.rst')%0A%0A        with open(html_filename, 'w', encoding='utf-8') as fp:%0A            fp.write(content)%0A        os.system('pandoc --from=html --to=rst -o %25s %25s' %25 (rst_filename,%0A            html_filename))%0A

Add a import script I've used to convert from a wordpress xml file.