redditparser module

class redditparser.RedditParser(client_id, client_secret, password, user_agent, username)[source]

Bases: object

get_aboutuser(username)[source]

Returns the user additional information about user using about.json of the user

Parameters:username – Redditor username (str)
Returns:Returns tuple of (created, comment_karma, link_karma, verified, is_gold, is_mod, is_employee)
get_agegender(title)[source]

Get age and gender from the title if given

Parameters:title – Submission.title object (str)
Returns:Returns age, gender (str tuple)
get_score(comments)[source]

Gets the average attractiveness score from submission

Parameters:comments – Comments from submission
Returns:Returns tuple of Score (float), Number of Comment count (int)
parse_rateme(query_level)[source]

Main runner method for reddit parsing

Returns:Returns number of the people has been parsed (int)
query_level(level)[source]

Returns the query level - epoch correspondence

Parameters:level – query level (str) available levels: 1day, 1week, 1month, 3months, 6months, 1year, 3year
Returns:Epoch time of query level
setup_imagepath(path='data/images')[source]

Creates directory if it does not exist, and removes everything

Parameters:path – Full path to be created
Returns:
store_media(submission, fullpath)[source]

Stores the preview image under RateMe/data/image without any optimization

Parameters:
  • submission – Submission object of PRAW
  • fullpath – Fullpath of image to be saved
Returns:

Returns True on successful operation