{ "info": { "author": "David Thenon", "author_email": "dthenon@emencia.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.4", "Framework :: Django :: 1.5", "Framework :: Django :: 1.6", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. _six: https://pypi.python.org/pypi/six\n.. _Django: https://www.djangoproject.com/\n.. _feedparser: https://github.com/kurtmckee/feedparser\n.. _requests: http://docs.python-requests.org/\n.. _DjangoCMS: https://www.django-cms.org\n.. _cmsplugin_feedparser: https://github.com/sveetch/cmsplugin-feedparser\n\n=================\ndjango-feedparser\n=================\n\nA `Django`_ app using `feedparser`_ to fetch and parse a feed to render it from a template. \n\nIt is not a Feed agregator since it manage feeds one by one.\n\n* `requests`_ is used to fetch feeds;\n* `feedparser`_ is used to parse feeds;\n* Django cache is used to avoid fetching again the feed each time;\n* Basic feed renderers just parse the feed without modifying anything but you can extend it to implement your post-process formatting;\n* Once the feed has been fetched, it can be displayed through a template. Default template is really basic and you should eventually override it or create another one to fit to your feed structure/format;\n* A `DjangoCMS`_ plugin is available on `cmsplugin_feedparser`_;\n\nLinks\n*****\n\n* Download his `PyPi package `_;\n* Clone it on his `repository `_;\n\nRequires\n********\n\n* `six`_;\n* `Django`_ >= 1.4;\n* `requests`_ >= 2.7.0',\n* `feedparser`_ >= 5.1.3',\n\nInstall\n*******\n\nFirst install the package: ::\n\n pip install django-feedparser\n\nAdd it to your installed Django apps in settings: ::\n\n INSTALLED_APPS = (\n ...\n 'django_feedparser',\n ...\n )\n\nThen import its settings: ::\n\n from django_feedparser.settings import *\n\nAnd finally see about `Available settings`_ you can override.\n\nUsage\n*****\n\nRenderers\n---------\n\nThere is actually two basic renderer available:\n\nbasic-xml\n Just the basic renderer, parsing an XML feed and return result given by `feedparser`.\n \n Don't do any special formatting.\nbasic-json\n Like ``basic-xml`` but for a JSON feed, obviously don't use `feedparser` but \n the ``json`` builtin from Python and return the loaded object.\n\nFinally, remember than your renderer have to be compatible with the used template and vice-versa.\n\nViews\n-----\n\nThere is a mixin ``django_feedparser.views.FeedFetchMixin`` you can inherit from your views to exploit a feed.\n\nAnd there is a basic view ``django_feedparser.views.FeedView`` that inherits from mixin ``FeedFetchMixin`` to demonstrate its usage. However the basic view is usable as it if it meets your needing, if so you just have to use it directly in your urls like ``django.views.generic.base.TemplateView``: ::\n \n from django.conf.urls import *\n\n from .views import FeedView\n\n urlpatterns = patterns('',\n ...\n url(r'^myfeed/$', FeedView.as_view(feed_url=\"http://localhost/myfeed.xml\"), name=\"myfeed\"),\n ...\n )\n\n.. NOTE::\n Although the app contains an 'urls.py', it's mainly intended for debugging purpose, you should not mount it in your project urls.\n\nTemplate tags\n-------------\n\nMore common way is to use the template tag to include rendered feed in your templates.\n\nBasic sample: ::\n\n {% load feedparser_tags %}\n {% feedparser_render 'http://localhost/sample.xml' %}\n\nOr with all accepted arguments: ::\n\n {% feedparser_render 'http://localhost/sample.xml' renderer='CustomRenderer' template='foo/custom.html' expiration=3600 %}\n\n\nAvailable settings\n******************\n\nFEED_RENDERER_DEFAULT_TEMPLATE\n Path to the default renderer template.\n \n **Default value**: ``'django_feedparser/basic_feed_renderer.html'``\n\nFEED_CACHE_KEY\n Feed cache key template string.\n \n **Default value**: ``'feedparser_feed_{id}_{expire}'``\n\nFEED_TIMEOUT\n Timeout until feed response, in seconds.\n \n **Default value**: ``5``\n\nFEED_BOZO_ACCEPT\n Wether we accept (``True``) badly formatted xml feed or not (``False``).\n \n **Default value**: ``True``\n\nFEED_SAFE_FETCHING\n Wether fetching a feed throw an exception (False) or not (True).\n \n Bad http status, request errors and timeout error are silently catched when safe fetching is enabled.\n \n **Default value**: ``False``\n\nFEED_RENDER_ENGINES\n A Python dictionnary for available renderer engines, where the key is the shortcut \n engine name and the value is a valid Python path to the renderer class.\n \n **Default value**: ::\n \n {\n 'basic-xml': 'django_feedparser.renderer.FeedBasicRenderer',\n 'basic-json': 'django_feedparser.renderer.FeedBasicRenderer',\n }\n\nDEFAULT_FEED_RENDER_ENGINE\n The default renderer engine name to use when no one is given.\n \n **Default value**: ``basic-xml``", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sveetch/django-feedparser", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-feedparser", "package_url": "https://pypi.org/project/django-feedparser/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-feedparser/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sveetch/django-feedparser" }, "release_url": "https://pypi.org/project/django-feedparser/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "A Django app using 'feedparser' to fetch and parse a feed to render it from a template", "version": "0.2.1" }, "last_serial": 1972946, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8b788dd2ec8508fe2d1e1f486516007a", "sha256": "968ff7786ed41f97eb4280b0604fdd6af7180455a702d15002725ab75f099e48" }, "downloads": -1, "filename": "django-feedparser-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8b788dd2ec8508fe2d1e1f486516007a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8226, "upload_time": "2015-12-06T17:59:02", "url": "https://files.pythonhosted.org/packages/c8/28/fca3d5673063fc65cdcd3698c92e1aef273ba0d60bb33873fe1a69347e6f/django-feedparser-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "6494cd4efda11b1883bd05d6c324f983", "sha256": "cd3d929f4ee3174bf3e4e6d230093a39f1a4a486ea2a376e0d8e1013d36744ed" }, "downloads": -1, "filename": "django-feedparser-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6494cd4efda11b1883bd05d6c324f983", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8664, "upload_time": "2015-12-09T20:23:27", "url": "https://files.pythonhosted.org/packages/f0/19/5459f1a534f1fdf89285f28533a87adee17fea363c6b00458c37c5d3bdb2/django-feedparser-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "2c02c70cd9fe91dc0cfb982e8a5041a3", "sha256": "67aa32ae635b87d2ea5fdd71ed0ef76a3597bf9f1818107dc2b28f40fdbbd099" }, "downloads": -1, "filename": "django-feedparser-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2c02c70cd9fe91dc0cfb982e8a5041a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9595, "upload_time": "2015-12-15T18:08:21", "url": "https://files.pythonhosted.org/packages/6b/84/da119738c570256d2d5450bee85357af7fcd7ee6235da07e1516fb0fec42/django-feedparser-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "6eded1b52e93061f0e2219e9593adcae", "sha256": "83a825b1d91bd5ba26eeee6dc8f37d2e0357ab0c82b0f916daf535ec2faea25e" }, "downloads": -1, "filename": "django-feedparser-0.2.1.tar.gz", "has_sig": false, "md5_digest": "6eded1b52e93061f0e2219e9593adcae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9764, "upload_time": "2016-02-24T00:23:01", "url": "https://files.pythonhosted.org/packages/fa/30/b58deb46a9614ec46e6ac264e818c803cf08c42123afed2191b4e2912770/django-feedparser-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6eded1b52e93061f0e2219e9593adcae", "sha256": "83a825b1d91bd5ba26eeee6dc8f37d2e0357ab0c82b0f916daf535ec2faea25e" }, "downloads": -1, "filename": "django-feedparser-0.2.1.tar.gz", "has_sig": false, "md5_digest": "6eded1b52e93061f0e2219e9593adcae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9764, "upload_time": "2016-02-24T00:23:01", "url": "https://files.pythonhosted.org/packages/fa/30/b58deb46a9614ec46e6ac264e818c803cf08c42123afed2191b4e2912770/django-feedparser-0.2.1.tar.gz" } ] }