def __init__(self, user: dict): self.contributors_enabled = bool_attr(user, 'contributors_enabled') self.created_at = datetime_attr(user, 'created_at') self.default_profile = bool_attr(user, 'default_profile') self.default_profile_image = bool_attr(user, 'default_profile_image') self.description = str_attr(user, 'description') self.entities = obj_attr(user, 'entities', UserEntities) self.favourites_count = int_attr(user, 'favourites_count') self.follow_request_sent = bool_attr(user, 'follow_request_sent') self.following = bool_attr(user, 'following') # deprecated self.followers_count = int_attr(user, 'followers_count') self.friends_count = int_attr(user, 'friends_count') self.geo_enabled = bool_attr(user, 'geo_enabled') self.has_extended_profile = bool_attr(user, 'has_extended_profile') self.id_ = int_attr(user, 'id') self.is_translation_enabled = bool_attr(user, 'is_translation_enabled') # not in docs self.is_translator = bool_attr(user, 'is_translator') self.lang = str_attr(user, 'lang') self.listed_count = int_attr(user, 'listed_count') self.location = str_attr(user, 'location') self.name = str_attr(user, 'name') self.notifications = bool_attr(user, 'notifications') # deprecated self.profile = UserProfile(user) self.protected = bool_attr(user, 'protected') self.screen_name = str_attr(user, 'screen_name') self.show_all_inline_media = bool_attr(user, 'show_all_inline_media') self.statuses_count = user['statuses_count'] self.time_zone = user['time_zone'] self.url = user['url'] self.utc_offset = user['utc_offset'] self.verified = user['verified']
def __init__(self, metadata: dict): self.completed_in = float_attr(metadata, 'completed_in') self.count = int_attr(metadata, 'count') self.max_id = int_attr(metadata, 'max_id') self.next_results = str_attr(metadata, 'next_results') self.query = str_attr(metadata, 'query') self.refresh_url = str_attr(metadata, 'refresh_url') self.since_id = int_attr(metadata, 'since_id')
def __init__(self, media: dict): self.display_url = str_attr(media, 'display_url') self.expanded_url = str_attr(media, 'expanded_url') self.id_ = int_attr(media, 'id') self.indices = list_int_attr(media, 'indices') self.media_url = str_attr(media, 'media_url') self.media_url_https = str_attr(media, 'media_url_https') self.sizes = obj_attr(media, 'sizes', Sizes) # type: Sizes self.source_status_id = int_attr(media, 'source_status_id') self.type_ = str_attr(media, 'type') self.url = str_attr(media, 'url')
def __init__(self, tweet: dict): self.contributors = list_obj_attr(tweet, 'contributors', Contributor) self.coordinates = obj_attr(tweet, 'coordinates', TweetCoordinates) self.created_at = datetime_attr(tweet, 'created_at') self.current_user_retweet = obj_attr(tweet, 'current_user_retweet', CurrentUserRetweet) self.entities = obj_attr(tweet, 'entities', Entities) self.favorite_count = int_attr(tweet, 'favorite_count') self.favorited = bool_attr(tweet, 'favorited') self.filter_level = str_attr(tweet, 'filter_level') self.geo = obj_attr(tweet, 'geo', Geo) # deprecated self.id_ = int_attr(tweet, 'id') self.in_reply_to_screen_name = int_attr(tweet, 'in_reply_to_screen_name') self.in_reply_to_status_id = int_attr(tweet, 'in_reply_to_status_id') self.in_reply_to_user_id = int_attr(tweet, 'in_reply_to_user_id') self.lang = str_attr(tweet, 'lang') self.place = obj_attr(tweet, 'place', Place) self.possibly_sensitive = bool_attr(tweet, 'possibly_sensitive') self.quoted_status_id = int_attr(tweet, 'quoted_status_id') self.quoted_status = obj_attr(tweet, 'quoted_status', type(self)) self.scopes = dict_attr(tweet, 'scopes') self.retweet_count = int_attr(tweet, 'retweet_count') self.retweeted = bool_attr(tweet, 'retweeted') self.retweeted_status = obj_attr(tweet, 'retweeted_status', type(self)) self.source = str_attr(tweet, 'source') self.text = str_attr(tweet, 'text') self.truncated = bool_attr(tweet, 'truncated') self.user = obj_attr(tweet, 'user', User) self.withheld_copyright = bool_attr(tweet, 'withheld_copyright') self.withheld_in_countries = list_str_attr(tweet, 'withheld_in_countries') self.withheld_scope = str_attr(tweet, 'withheld_scope')
def __init__(self, contributor: dict): self.id_ = int_attr(contributor, 'id') self.screen_name = str_attr(contributor, 'screen_name')
def __init__(self, user_mention: dict): self.id_ = int_attr(user_mention, 'id') self.indices = list_int_attr(user_mention, 'indices') self.name = str_attr(user_mention, 'name') self.screen_name = str_attr(user_mention, 'screen_name')
def __init__(self, location: dict): self.name = str_attr(location, 'name') self.woe_id = int_attr(location, 'woeid')
def __init__(self, size: dict): self.height = int_attr(size, 'h') self.width = int_attr(size, 'w') self.resize = str_attr(size, 'resize')