pyrsslocal documentation

Build status Build Status Windows https://circleci.com/gh/sdpython/pyrsslocal/tree/master.svg?style=svg https://badge.fury.io/py/pyrsslocal.svg GitHub Issues MIT License https://codecov.io/github/sdpython/pyrsslocal/coverage.svg?branch=master size

Links: pypi, github, documentation, wheel, pyrsslocal: local RSS reader, blog, Issues

What is it?

This extension proposes a way to download new posts from blogs and to navigate through them with a couple of HTML pages managed by a local python server using a SQLite database:

from pyrsslocal import rss_update_run_server
fLOG (OutputPrint=True)
xml_blogs = "subscriptions.xml"
# xml_blogs = os.path.join("_unittests", "ut_rss", "data", "subscriptions.xml")
dbfile = "rss_posts.db3"
rss_update_run_server(dbfile, xml_blogs)

The previous example takes a dump of blogs url coming from the former Google Reader (see below), downloads RSS streams, loads everything into a database (SQLlite format), and opens a local web application to read them, mark them, or search their titles. The XML file which describes the blogs looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
    <body>

        <!--
        <outline text=""
            title=""
            type="rss"
            xmlUrl=""
            htmlUrl=""/>
            -->

        <outline text="XD blog"
                 title="XD blog"
                 type="rss"
                 xmlUrl="http://www.xavierdupre.fr/blog/xdbrss.xml"
                 htmlUrl="http://www.xavierdupre.fr/blog/xd_blog.html" />

    </body>
</opml>

You can create an empty with:

from pyrsslocal import write_subscriptions_example
xml_blogs = "subscriptions.xml"
write_subscriptions_example(xml_blogs)

You can enumerate the blog posts in the database:

from pyrsslocal import pyrsslocal
db = DatabaseRSS(dbfile, LOG = fLOG)
for blog in db.enumerate_posts() :
    print (blog)

Installation

pip install pyrsslocal

Snapshots

Main page:

_images/page1.png

Marked blog posts:

_images/page2.png

Search page:

_images/page3.png

Quick start

Functionalities

  • retrieve blog posts and store them into a SQLite database

  • Python server accepting python script inside HMTL pages

  • run Python script after adding variables to the script context

  • download webpage and handle encoding

  • javascript files to emphasize python syntax in a HTML page

  • a custom server to HTML as an interface for a local program

Indices and tables

Modules

Functions

Classes

Methods

Static Methods

Properties

Module Index

l-example

Search Page

License

Changes

pyrsslocal: local RSS reader

Index

l-FAQ

Notebook Gallery

Statistics on code

Unit Test Coverage