pyconversations.message.Tweet

class pyconversations.message.Tweet(**kwargs)[source]

Twitter post object with additional Twitter-specific features

get_mentions()[source]

Uses Twitter specific regex to attempt to identify user mentions within the comment text.

Returns a set of usernames.

static parse_datestr(x)[source]

Static method that specifies how to convert the native datetime string into a a Python datetime object.

Parameters

x – The raw datetime string

static parse_raw(data, lang_detect=False)[source]

Static method that must be implemented by all non-abstract child classes. Concrete implementations should specify how to parse the raw data into this object. Returns a list of Twitter posts.

Parameters
  • data – The raw data to be pre-processed.

  • lang_detect – A boolean which specifies whether language detection should be activated. (Default: False)