classes package

Submodules

classes.InstagramMetricParser module

Child class inherited from SocMetricParser for instagram. This class using instagram api v1.0 with tabular method.

class classes.InstagramMetricParser.InstagramMetricParser(header: dict, db_session: dict, soc_type: int)[source]

Bases: SocMetricParserAbstraction, ABC

parse_profile_metrics(item: dict) None[source]

realization of abstract method for instagram resources via instagram api :param item: representation of instagram resource. example: https://www.instagram.com/police_astana_rop_saryarka/ :type item: dict

parse_profile_posts(item: dict) None[source]

realization of abstract method for instagram posts via instagram api

Parameters

item (dict) – representation of instagram resource. example: https://www.instagram.com/police_astana_rop_saryarka/

response_by_url(url) dict[source]

trying to get response from url if session, proxy or header invalid, trying to change them

Parameters

url (str) – getting url to connect with instragram session

run() None[source]

realization of abstact method, intended to link the crucial methods and run the parser

set_proxy() None[source]

getting proxy from database

update_session()[source]

tries to get an Instagram session if the previous one was banned

classes.TwitterMetricParser module

Child class inherited from SocMetricParser for instagram. This class using twitter api with tabular method.

class classes.TwitterMetricParser.TwitterMetricParser(header: dict, db_session: dict, soc_type: int)[source]

Bases: SocMetricParserAbstraction, ABC

get_twitter_tokens() list[tuple[models.models.Tokens]][source]
parse_profile_metrics() None[source]

realization of abstract method for twitter resources via twitter api

parse_profile_posts() None[source]

realization of abstract method for twitter posts via twitter api

run() None[source]

realization of abstact method, intended to link the crucial methods and run the parser

set_proxy() None[source]

Module contents

class classes.InstagramMetricParser(header: dict, db_session: dict, soc_type: int)[source]

Bases: SocMetricParserAbstraction, ABC

parse_profile_metrics(item: dict) None[source]

realization of abstract method for instagram resources via instagram api :param item: representation of instagram resource. example: https://www.instagram.com/police_astana_rop_saryarka/ :type item: dict

parse_profile_posts(item: dict) None[source]

realization of abstract method for instagram posts via instagram api

Parameters

item (dict) – representation of instagram resource. example: https://www.instagram.com/police_astana_rop_saryarka/

response_by_url(url) dict[source]

trying to get response from url if session, proxy or header invalid, trying to change them

Parameters

url (str) – getting url to connect with instragram session

run() None[source]

realization of abstact method, intended to link the crucial methods and run the parser

set_proxy() None[source]

getting proxy from database

update_session()[source]

tries to get an Instagram session if the previous one was banned

class classes.TwitterMetricParser(header: dict, db_session: dict, soc_type: int)[source]

Bases: SocMetricParserAbstraction, ABC

get_twitter_tokens() list[tuple[models.models.Tokens]][source]
parse_profile_metrics() None[source]

realization of abstract method for twitter resources via twitter api

parse_profile_posts() None[source]

realization of abstract method for twitter posts via twitter api

run() None[source]

realization of abstact method, intended to link the crucial methods and run the parser

set_proxy() None[source]