Readme Module

Everything except for configuration.

Models

class readme.models.Item(*args, **kwargs)[source]

Entry in the read-it-later-list

created = None

param created Creating date of the item

fetch_article()[source]

Fetches a title and a readable_article for the current url. It uses the scrapers module for this and only downloads the content.

owner

param owner Owning user

readable_article = None

param readable_article Processed content of the url

safe_article = None

param safe_article Escaped and stripped of tags

tags = <taggit.managers._TaggableManager object at 0x7f1b5624b860>

param tags User assigned tags

title = None

param title Page title

url = None

param url Page url

class readme.models.ItemTag(*args, **kwargs)[source]

ItemTag(id, name, slug)

class readme.models.TaggedItem(*args, **kwargs)[source]

TaggedItem(id, tag_id, content_object_id)

class readme.models.UserProfile(*args, **kwargs)[source]

UserProfile(user_id, theme, can_invite, new_window, items_per_page, show_excluded)

id[source]

Just to tell the TaggableManager what the primary key of this model is

Scrapers

exception readme.scrapers.ParserException[source]

Generic exception for parsers/scrapers. Indicates that a scraper cannot succeed.

readme.scrapers.domain_parser(domain)[source]

Decorator to register a domain specific parser

Parameters:domain – String
Returns:function
readme.scrapers.parse(item, content_type, text=None, content=None)[source]

Scrape info from an item

Parameters:
  • content_type – mime type
  • text – unicode text
  • content – byte string
  • item – Item
readme.scrapers.parse_github(item, content_type, text)[source]

Reads the readme of a repo if it can find one.

Parameters:
  • item – ignored
  • content_type – ignored
  • text – unicode text
Returns:

title, article

Raises ParserException:
 

raised of no readme is found

readme.scrapers.parse_web_page(text)[source]

Generic wep page parser with readability. Used as a fallback.

Parameters:text – unicode text
Returns:title, article
Raises ParserException: