{ "info": { "author": "Andrew Dalke", "author_email": "dalke@dalkescientific.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.5", "Topic :: Internet :: WWW/HTTP" ], "description": " PyRSS2Gen-1.1\n\n A Python library for generating RSS 2.0 feeds.\n\nRequires at least Python 2.3. (Uses the datetime module for timestamps.)\nAlso works under Python 3.x\n\nTo install:\n\n % python setup.py install\n\nThis uses the standard Python installer. For more details, read\n\n http://docs.python.org/inst/inst.html\n\n(And there's only one file, so you could just copy it wherever you\nneed it.)\n\nThe documentation was written in 2003 which is why the examples\nare a bit dated. Don't let that dissuade you! It's now 2012 and\nmany people are still using the package. There have been (minor)\nbug fixes during the time, and even a port to Python3.\n\n\n ====== ====== ====== ====== ====== ====== ====== ======\n\nI've finally decided to catch up with 1999 and play around a bit with\nRSS. I looked around, and while there are many ways to read RSS there\nare remarkably few which write them. I could use a DOM or other\nconstruct, but I want the code to feel like Python. There are more\nPythonic APIs I might use, like the effbot's ElementTree, but I also\nwanted integers, dates, and lists to be real integers, dates, and\nlists. (And I want bug-eyed monsters from Alpha Centauri to be *real*\nbug-eyed monsters from Alpha Centauri - is that too much I ask you?)\n\nThe RSS generators I found were built around print statements.\nWorkable, but they almost invariably left out proper HTML escaping the\nsort which leads to Mark Pilgrim's to write feed_parser, to make sense\nof documents which are neither XML nor HTML. Annoying, but sadly all\ntoo common.\n\nSo I messed around a bit with the spec from\n http://blogs.law.harvard.edu/tech/rss\n\nThe result looks like this:\n\nimport datetime\nimport PyRSS2Gen\n\nrss = PyRSS2Gen.RSS2(\n title = \"Andrew's PyRSS2Gen feed\",\n link = \"http://www.dalkescientific.com/Python/PyRSS2Gen.html\",\n description = \"The latest news about PyRSS2Gen, a \"\n \"Python library for generating RSS2 feeds\",\n\n lastBuildDate = datetime.datetime.now(),\n\n items = [\n PyRSS2Gen.RSSItem(\n title = \"PyRSS2Gen-0.0 released\",\n link = \"http://www.dalkescientific.com/news/030906-PyRSS2Gen.html\",\n description = \"Dalke Scientific today announced PyRSS2Gen-0.0, \"\n \"a library for generating RSS feeds for Python. \",\n guid = PyRSS2Gen.Guid(\"http://www.dalkescientific.com/news/\"\n \"030906-PyRSS2Gen.html\"),\n pubDate = datetime.datetime(2003, 9, 6, 21, 31)),\n PyRSS2Gen.RSSItem(\n title = \"Thoughts on RSS feeds for bioinformatics\",\n link = \"http://www.dalkescientific.com/writings/diary/\"\n \"archive/2003/09/06/RSS.html\",\n description = \"One of the reasons I wrote PyRSS2Gen was to \"\n \"experiment with RSS for data collection in \"\n \"bioinformatics. Last year I came across...\",\n guid = PyRSS2Gen.Guid(\"http://www.dalkescientific.com/writings/\"\n \"diary/archive/2003/09/06/RSS.html\"),\n pubDate = datetime.datetime(2003, 9, 6, 21, 49)),\n ])\n\nrss.write_xml(open(\"pyrss2gen.xml\", \"w\"))\n\n\nThe output does not contain newlines, so if you want to read it,\nyou'll need to use your favorite XML tools to reformat it.\n\nRSS is not a fixed format. People are free to add various metadata,\nlike Dublin Core elements.\n\nThe RSS objects are converted to XML using the 'publish' method, which\ntakes a SAX2 ContentHandler. If you want different output, implement\nyour own 'publish'. The \"simple\" data types which takes a string,\nint, or date, can be replaced with a publishable object, so you can\nadd metadata to, say, the \"description\" field. To support new\nelements for RSS and RSSItem, derive from them and use the\n'publish_extensions\" hook. To add your own attributes (needed for\nnamespace declarations), redefine 'element_attrs' or 'rss_attrs' in\nyour subclass.\n\nTo use a different encoding, create your own ContentHandler instead of\nusing the helper methods 'to_xml' and 'write_xml.' You'll need to\nmake sure the 'characters' method in the handler does the appropriate\ntranslation.\n\nThe \"categories\" list is somewhat special. It needs to be a list and\ndoesn't have a publish method. That's because the RSS spec doesn't\nhave an explicit concept for the set of categories -- an RSS2 channel\ncan have 0 or more 'category' elements, but doesn't have a \"list of\ncategories\" -- my \"categories\" attribute is an API fiction.\n\nBUGS:\n\nSeveral people have used this package since its first release in\nSeptember of 2003 and reported a couple of bugs. All those are fixed.\nThere are no known bugs.\n\nThe name PyRSS2Gen is a mouthful. It didn't think it was useful to\ncome up with a cute name. You might consider having\n\n import PyRSS2Gen as RSS2\n\nin any code which uses this module. I'm not changing the name because\nanyone who reads \"RSS2\" will likely think it's a parser and not a\ngenerator. Plus, the current name is very easy to find via a web\nsearch.\n\nLICENSE:\n\nThis is copyright (c) by Andrew Dalke Scientific, AB (previously\n'Dalke Scientific Software, LLC') and released under the BSD\nlicense. See the file LICENSE in the distribution, or \n http://www.opensource.org/licenses/bsd-license.php\nfor details.\n\nCHANGES for 1.1: Released August 25, 2012\n - Ported to Python 3.x. Thanks to Graham Bell for the initial patch.\n\nCHANGES for 1.0: Released November 6, 2005\n - Many people (Richard Chamberlain, Daniel Hsu, Leonart Richardson\n and Daniel Holth) pointed out that Guid sets \"isPermaLink\" (with a\n \"L\" not \"l\"). Fixed, and changed it so the isPermaLink RSS attribute\n is always either \"true\" or \"false\" instead of assuming empty means false.\n\n - Added patches from Erik de Jonge and MATSUNO Tokuhiro to set the\n output encoding.\n\n - Implemented a suggestion by Daniel Hoth to convert the enclosure\n length to a string.\n\nCHANGES for 0.1.1: Released in September 2003\n - retroactively renamed \"0.0\" to \"0.1\"\n - fixed bug in Image height. Patch thanks to Edward Dale.\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://dalkescientific.com/Python/PyRSS2Gen.html", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "PyRSS2Gen", "package_url": "https://pypi.org/project/PyRSS2Gen/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/PyRSS2Gen/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://dalkescientific.com/Python/PyRSS2Gen.html" }, "release_url": "https://pypi.org/project/PyRSS2Gen/1.1/", "requires_dist": null, "requires_python": null, "summary": "Generate RSS2 using a Python data structure", "version": "1.1" }, "last_serial": 5198301, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "eae2bc6412c5679c287ecc1a59588f75", "sha256": "4929d022713129401160fd47550d5158931e4ea6a7136b5d8dfe3b13ac16f2f0" }, "downloads": -1, "filename": "PyRSS2Gen-1.0.0.tar.gz", "has_sig": false, "md5_digest": "eae2bc6412c5679c287ecc1a59588f75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9284, "upload_time": "2009-04-22T01:13:35", "url": "https://files.pythonhosted.org/packages/a6/55/97e9bcc524e0a524c8274f71cdcd60b65971bed82e4bfb98a42b1af3fe0a/PyRSS2Gen-1.0.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "3529f831c6a4ed717b55315974e16317", "sha256": "7960aed7e998d2482bf58716c316509786f596426f879b05f8d84e98b82c6ee7" }, "downloads": -1, "filename": "PyRSS2Gen-1.1.tar.gz", "has_sig": false, "md5_digest": "3529f831c6a4ed717b55315974e16317", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6854, "upload_time": "2013-02-21T03:23:02", "url": "https://files.pythonhosted.org/packages/6d/01/fd610d5fc86f7dbdbefc4baa8f7fe15a2e5484244c41dcf363ca7e89f60c/PyRSS2Gen-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3529f831c6a4ed717b55315974e16317", "sha256": "7960aed7e998d2482bf58716c316509786f596426f879b05f8d84e98b82c6ee7" }, "downloads": -1, "filename": "PyRSS2Gen-1.1.tar.gz", "has_sig": false, "md5_digest": "3529f831c6a4ed717b55315974e16317", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6854, "upload_time": "2013-02-21T03:23:02", "url": "https://files.pythonhosted.org/packages/6d/01/fd610d5fc86f7dbdbefc4baa8f7fe15a2e5484244c41dcf363ca7e89f60c/PyRSS2Gen-1.1.tar.gz" } ] }