Code Monkey home page Code Monkey logo

atoma's Introduction

Atoma

https://travis-ci.org/NicolasLM/atoma.svg?branch=master https://coveralls.io/repos/github/NicolasLM/atoma/badge.svg?branch=master

Atom, RSS and JSON feed parser for Python 3.

Quickstart

Install Atoma with pip:

pip install atoma

Load and parse an Atom XML file:

>>> import atoma
>>> feed = atoma.parse_rss_file('rss-feed.xml')
>>> feed.description
'The blog relating the daily life of web agency developers'
>>> len(feed.items)
5

Parsing feeds from the Internet is easy as well:

>>> import atoma, requests
>>> response = requests.get('http://lucumr.pocoo.org/feed.atom')
>>> feed = atoma.parse_atom_bytes(response.content)
>>> feed.title.value
"Armin Ronacher's Thoughts and Writings"

Features

Security warning

If you use this library to display content from feeds in a web page, you NEED to clean the HTML contained in the feeds to prevent Cross-site scripting (XSS). The bleach library is recommended for cleaning feeds.

Useful Resources

To use this library a basic understanding of feeds is required. For Atom, the Introduction to Atom is a must read. The RFC 4287 can help lift some ambiguities. Finally the feed validator is great to test hand-crafted feeds.

For RSS, the RSS specification and rssboard.org have a ton of information and examples.

For OPML, the OPML specification has a paragraph dedicated to its usage for syndication

Non-implemented Features

Some seldom used features are not implemented:

  • XML signature and encryption
  • Some Atom and RSS extensions
  • Atom content other than text, html and xhtml

License

MIT

atoma's People

Contributors

nicolaslm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.