Models#
TweetKit Modules
Includes implementations of TweetKit module methods.
Expansions Module#
ObjectStore
Paginator Module#
Paginator
Request Module#
Request
Response Module#
Response
- class tweetkit.models.response.TwitterResponse(content, dtype=None, **kwargs)#
Bases:
object- property content#
Gets list of objects or object dict.
- property data#
Gets data from the response.
- Returns:
The data of response.
- Return type:
dict
- property dtype#
Gets data-type of the response.
- Returns:
The data-type of response.
- Return type:
str
- property errors#
Gets errors from the response.
- Returns:
The errors of response.
- Return type:
list of TwitterProblem
- get(item, default=None)#
Gets item from data. Returns list if there are multiple objects in data.
- Parameters:
item (str) – The key to extract the data.
default (Any) – The default return value.
- Return type:
The data item referred by the provided key.
- property includes#
Gets includes from the response.
- Returns:
The includes of response.
- Return type:
dict
- property meta#
Gets errors from the response.
- Returns:
The errors component of response.
- Return type:
dict
- to_json(path_or_buf=None, *args, **kwarg)#
Convert the object to a JSON string.
- Parameters:
path_or_buf (str, path object, file-like object, or None, default None) – String, path object (implementing os.PathLike[str]), or file-like object implementing a write() function. If None, the result is returned as a string.
- Returns:
If path_or_buf is None, returns the resulting json format as a string. Otherwise returns None.
- Return type:
None or str