user submodule

This module is here to allow basic manipulation with users. It allows you to retreive all blogposts for fiven user, upload new concepts, register blog and so on.

class abclinuxuapi.user.User(username, password=None, lazy=False)

Bases: object

Class that is used to hold informations about given username. You can also command various operations, like get list of all blogs, or add new concept.




str, default None – Password for logged user.


bool – Is the user logged in?

  • username (str) – Users login.
  • password (str, default None) – Optional password for given user. This will allow you to upload concepts.
  • lazy (bool, default False) – Don’t call lazy_init() right when the object is created.

Does the user have registered blog?


Parse additional informations about user. This step require one request to the site.

static from_user_id(user_id)

Transform user_id to instance of User.

Returns:User instance parsed from the user_id.
Return type:obj

Logs the user in, tests, if the user is really logged.

Parameters:password (str, default None) – Password, overwrites the password set when the object was created.
Raises:UserWarning – if there was some error during login.

Lists all of users PUBLISHED blogposts. For unpublished, see get_concepts().

Returns:sorted (old->new) list of Blogpost objects.
Return type:list

Return all concepts (unpublished blogs).

Returns:List of Concept objects.
Return type:list
add_concept(text, title, ts_of_pub=None)

Adds new concept into your concepts.

  • text (str) – Text of your concept.
  • title (str) – Title of your contept. Do not use HTML in title!
  • ts_of_pub (int/float, default None) – Timestamp of the publication.

UserWarning – if the site is broken or user was logged out.


Register blog under blog_name. Users doesn’t have blogs automatically, you have to create them manually.

  • UserWarning – If user already have blog registered.
  • ValueError – If it is not possible to register blog for user (see exception message for details).