Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Pandas integration

Francesco Poldi edited this page Aug 13, 2019 · 1 revision

Pandas dataframes are supported, by default the format is .h5 (.pkl is supported as well).

Useful functions

  • twint.storage.panda.save
  • twint.storage.panda.read
  • twint.storage.panda.clean

Other functions exist but for internal usage.

Useful objects

  • twint.storage.panda.Follow_df: followers/following (only usernames
  • twint.storage.panda.Tweets_df: tweets
  • twint.storage.panda.User_df: users' information

Examples

Tweets

import twint

c = twint.Config()
c.Limit = 20
c.Username = username
c.Pandas = True

twint.run.Search(c)

Tweets_df = twint.storage.panda.Tweets_df

Followers

import twint

c = twint.Config()
c.Limit = 20
c.Username = username
c.Pandas = True

twint.run.Followers(c)

Followers_df = twint.storage.panda.Follow_df
list_of_followers = Followers_df['followers'][username]

Followers' information

import twint

c = twint.Config()
c.Limit = 20
c.Username = username
c.Pandas = True
c.User_full = True

twint.run.Followers(c)

Users_df = twint.storage.panda.User_df