Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
.. image:: https://travis-ci.org/NicolasLM/atoma.svg?branch=master :target: https://travis-ci.org/NicolasLM/atoma .. image:: https://coveralls.io/repos/github/NicolasLM/atoma/badge.svg?branch=master :target: https://coveralls.io/github/NicolasLM/atoma?branch=master
Atom, RSS and JSON feed parser for Python 3.
Install Atoma with pip::
pip install atoma
Load and parse an Atom XML file:
.. code:: python
>>> 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:
.. code:: python
>>> 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"
RSS 2.0 Specification <http://cyber.harvard.edu/rss/rss.html>
_RFC4287 <https://tools.ietf.org/html/rfc4287>
_JSON Feed specification <https://jsonfeed.org/version/1>
_OPML 2.0 <http://dev.opml.org/spec2.html>
_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) <https://en.wikipedia.org/wiki/Cross-site_scripting>
. The bleach <https://github.com/mozilla/bleach>
library is recommended for cleaning feeds.
To use this library a basic understanding of feeds is required. For Atom, the
Introduction to Atom <https://validator.w3.org/feed/docs/atom.html>
_ is a must
read. The RFC 4287 <https://tools.ietf.org/html/rfc4287>
_ can help lift some
ambiguities. Finally the feed validator <https://validator.w3.org/feed/>
_ is
great to test hand-crafted feeds.
For RSS, the RSS specification <http://cyber.harvard.edu/rss/rss.html>
_ and
rssboard.org <http://www.rssboard.org>
_ have a ton of information and
examples.
For OPML, the OPML specification <http://dev.opml.org/spec2.html#subscriptionLists>
_ has a paragraph dedicated
to its usage for syndication
Some seldom used features are not implemented:
text
, html
and xhtml
MIT Copyright (c) 2018 Nicolas Le Manchet
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Atom, RSS and JSON feed parser for Python 3
We found that atoma demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.