Python – What is the difference between “author” and “user” in Tweepy’s user object?

What is the difference between “author” and “user” in Tweepy’s user object?… here is a solution to the problem.

What is the difference between “author” and “user” in Tweepy’s user object?

I’m using Tweepy, a Twitter API wrapper for Python, to automate some events on Twitter.

Tweepy’s state object has a property called author, which displays author information for a particular tweet, but it also has another property named user.

There are some differences between these two properties, but they both appear to be information for the ‘same user’.

Are there cases where author and user display different user information? If yes, what’s the difference?

Solution

If you go to read source on GitHub, You will find:

            setattr(status, 'author', user)
            setattr(status, 'user', user)  # DEPRECIATED

So I’ll use the author attribute.

Related Problems and Solutions