Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jaymcgrath/367c521f1dd786bc5a05ec3eeeb1cb04 to your computer and use it in GitHub Desktop.
Save jaymcgrath/367c521f1dd786bc5a05ec3eeeb1cb04 to your computer and use it in GitHub Desktop.
# note - excludes __ and _ items
['author',
'contributors',
'coordinates',
'created_at',
'destroy',
'entities',
'favorite',
'favorite_count',
'favorited',
'geo',
'id',
'id_str',
'in_reply_to_screen_name',
'in_reply_to_status_id',
'in_reply_to_status_id_str',
'in_reply_to_user_id',
'in_reply_to_user_id_str',
'is_quote_status',
'lang',
'parse',
'parse_list',
'place',
'retweet',
'retweet_count',
'retweeted',
'retweets',
'source',
'source_url',
'text',
'truncated',
'user']
"""
@avaldez1412
Copy link

avaldez1412 commented Jan 27, 2017

Thanks!

I'm learning Python and Tweepy right now and this was helpful. I've found that some of these attributes have sub-attributes.

For example, if I got a status tweet object named "status" and printed out the string, '\n'.join(dir(status[0])), I'll get the same list you did.

If I printed the string '\n'.join(dir(status[0].author)), I'll get the following:

 __class__
__delattr__
__dict__
__dir__
__doc__
__eq__
__format__
__ge__
__getattribute__
__getstate__
__gt__
__hash__
__init__
__le__
__lt__
__module__
__ne__
__new__
__reduce__
__reduce_ex__
__repr__
__setattr__
__sizeof__
__str__
__subclasshook__
__weakref__
_api
_json
contributors_enabled
created_at
default_profile
default_profile_image
description
entities
favourites_count
follow
follow_request_sent
followers
followers_count
followers_ids
following
friends
friends_count
geo_enabled
has_extended_profile
id
id_str
is_translation_enabled
is_translator
lang
listed_count
lists
lists_memberships
lists_subscriptions
location
name
notifications
parse
parse_list
profile_background_color
profile_background_image_url
profile_background_image_url_https
profile_background_tile
profile_banner_url
profile_image_url
profile_image_url_https
profile_link_color
profile_sidebar_border_color
profile_sidebar_fill_color
profile_text_color
profile_use_background_image
protected
screen_name
statuses_count
time_zone
timeline
translator_type
unfollow
url
utc_offset
verified

@DonaldTsang
Copy link

DonaldTsang commented Jan 25, 2018

@jaymcgrath So which of theses are retweets, favs, media count, URLs, reply info and poster info?

@marloz24
Copy link

marloz24 commented Apr 8, 2020

Hi whats the sources of this? It worked for me but I´m interested in more information

@prakhar897
Copy link

Thanks man, the creators can't bother to put this in their documentation.

@SomethingGeneric
Copy link

@prakhar897 honestly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment