pisak.blog package

pisak.blog.description module

pisak.blog.config module

Module for storing and managing all the blog configuration parameters.


Decrypt the given encrypted password.

Parameters:encrypted – encrypted password.
Returns:decrypted password, string.

Not very safe solution. Only for people who really are unable to remember their password. Anyone who gets here will be able to decrypt the password so we do not need to be very inventive.

Parameters:password – not encrypted password.
Returns:string with an encrpted password.

Get all the blog configurations.

Returns:tuple consisting of blog address, user name and user password.

Get list of all followed blogs.

Returns:list with all followed blogs

pisak.blog.handlers module

pisak.blog.widgets module

pisak.blog.exceptions module

Blog application specific exceptions.

exception pisak.blog.exceptions.BlogAuthenticationError(*args, **kwargs)[source]

Bases: pisak.exceptions.PisakException

Error raised when an authentication attempt fails.

exception pisak.blog.exceptions.BlogInternetError(*args, **kwargs)[source]

Bases: pisak.exceptions.PisakException

Error raised when any problems with connecting to the Internet occur.

exception pisak.blog.exceptions.BlogMethodError(*args, **kwargs)[source]

Bases: pisak.exceptions.PisakException

Error raised when any unexpected blog-related condition occurs.

pisak.blog.html_parsers module

Set of various HTML parsers.


Convert python-style linebreaks to a html-style ones.

Parameters:text – text with python-style linebreaks.
Returns:text with html-style linebreaks.

Apply html-style paragraphs to the text.

Parameters:text – text with python-style or no paragraphs.
Returns:text with html-style paragraphs.

Converts all html-style linebreaks to the python-style ones.

Parameters:parser – beautiful soup parser.

Remove all the img tags.

Parameters:content – html text.
Returns:content with img tags removed.
pisak.blog.html_parsers.embed_images(content, image_urls)[source]

Embed img tag with image url into the html content.

  • content – html text.
  • image_urls – url to the image or list of urls.

content with img tag embedded.


Get all plain text from a html document.

Parameters:content – html text.
Returns:plain text.

Extract and list all images in a html text.

Parameters:content – html text.
Returns:list of image urls.

pisak.blog.wordpress module

pisak.blog.rest_client module

Wordpress JSON REST API client implementation.

class pisak.blog.rest_client.Blog(address)[source]

Bases: object

Client of a blog that makes a JSON API avalaible.

Parameters:address – blog’s site domain (string) or ID (integer).

Compose and arrange all the post elements into a single html document.

Parameters:post – post instance
Returns:properly constructed post view

Get all posts from the blog.

Returns:list of all posts. Each post is a dictionary.

Get single comment.

Parameters:ide – id of the comment to be returned.
Returns:single comment. Comment is a dictionary.

Get all comments for the given post.

Parameters:post_ide – id of the post.
Returns:list of all comments for the given post.

Each comment is a dictionary

get_many_posts(offset, number)[source]

Retrieve many posts.

  • offset – offset from which posts should be taken.
  • number – number of posts to retrieve.

list of posts.


Get single post from the blog.

Parameters:ide – id of a post to be returned.
Returns:single post. Post is a dictionary.

Module contents


Test provided blog settings or server connection.