Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Atom, RSS and JSON feed parser for Python 3

License

NotificationsYou must be signed in to change notification settings

NicolasLM/atoma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Atom, RSS and JSON feed parser for Python 3.

Quickstart

Install Atoma with pip:

pip install atoma

Load and parse an Atom XML file:

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

A small change is needed if you are dealing with an RSS XML file:

>>>feed=atoma.parse_rss_feed('rss-feed.xml')

Parsing feeds from the Internet is easy as well:

>>>importatoma,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 NEEDto clean the HTML contained in the feeds to preventCross-site scripting (XSS). Thebleach library is recommended for cleaning feeds.

Useful Resources

To use this library a basic understanding of feeds is required. For Atom, theIntroduction to Atom is a mustread. TheRFC 4287 can help lift someambiguities. Finally thefeed validator isgreat to test hand-crafted feeds.

For RSS, theRSS specification andrssboard.org have a ton of information andexamples.

For OPML, theOPML specification has a paragraph dedicatedto 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 thantext,html andxhtml

License

MIT

About

Atom, RSS and JSON feed parser for Python 3

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp