Trying to port a script that connects to Twitter. The credentials are stored within a local json file
import twitter
credentials = load_json("/home/username/.cred.json")
twitter_api = twitter.Api(consumer_key=credentials["consumer_key"],
consumer_secret=credentials["consumer_secret"],
access_token_key=credentials["access_token_key"],
access_token_secret=credentials["access_token_secret"],
tweet_mode='extended')
But get there error:
twitter_api = twitter.Api(consumer_key=credentials["consumer_key"], AttributeError: module 'twitter' has no attribute 'Api'