README.rst 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. feedparser - Parse Atom and RSS feeds in Python.
  2. | Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org>
  3. | Copyright 2002-2008 Mark Pilgrim
  4. feedparser is open source. See the LICENSE file for more information.
  5. Installation
  6. ============
  7. Feedparser can be installed using distutils or setuptools by running::
  8. $ python setup.py install
  9. If you're using Python 3, feedparser will automatically be updated by the 2to3
  10. tool; installation should be seamless across Python 2 and Python 3.
  11. There's one caveat, however: sgmllib.py was deprecated in Python 2.6 and is no
  12. longer included in the Python 3 standard library. Because feedparser currently
  13. relies on sgmllib.py to handle illformed feeds (among other things), it's a
  14. useful library to have installed.
  15. If your feedparser download included a copy of sgmllib.py, it's probably called
  16. sgmllib3.py, and you can simply rename the file to sgmllib.py. It will not be
  17. automatically installed using the command above, so you will have to manually
  18. copy it to somewhere in your Python path.
  19. If a copy of sgmllib.py was not included in your feedparser download, you can
  20. grab a copy from the Python 2 standard library (preferably from the Python 2.7
  21. series) and run the 2to3 tool on it::
  22. $ 2to3 -w sgmllib.py
  23. If you copied sgmllib.py from a Python 2.6 or 2.7 installation you'll
  24. additionally need to edit the resulting file to remove the `warnpy3k` lines at
  25. the top of the file. There should be four lines at the top of the file that you
  26. can delete.
  27. Because sgmllib.py is a part of the Python codebase, it's licensed under the
  28. Python Software Foundation License. You can find a copy of that license at
  29. python.org:
  30. http://docs.python.org/license.html
  31. Documentation
  32. =============
  33. The feedparser documentation is available on the web at:
  34. https://pythonhosted.org/feedparser/
  35. It is also included in its source format, ReST, in the docs/ directory. To
  36. build the documentation you'll need the Sphinx package, which is available at:
  37. http://sphinx.pocoo.org/
  38. You can then build HTML pages using a command similar to::
  39. $ sphinx-build -b html docs/ fpdocs
  40. This will produce HTML documentation in the fpdocs/ directory.
  41. Testing
  42. =======
  43. Feedparser has an extensive test suite that has been growing for a decade. If
  44. you'd like to run the tests yourself, you can run the following command::
  45. $ python feedparsertest.py
  46. This will spawn an HTTP server that will listen on port 8097. The tests will
  47. fail if that port is in use.