jetblack_tweeter

class Tweeter

Summary

Initialise the Twitter client.

jetblack_tweeter.Tweeter(
session: AbstractTweeterSession,
app_key: str,
app_key_secret: str,
*,
access_token: Optional[str],
access_token_secret: Optional[str]
) -> None

Parameters

session: AbstractTweeterSession

The Twitter session implementation.

app_key: str

The app-key.

app_key_secret: str

The app-key-secret

access_token: Optional[str] (optional)

An optional access token. Defaults to None.

access_token_secret: Optional[str] (optional)

An optional access token secret. Defaults to None.

Attributes

account: Account

Access to the account end point.

search: Search

Access to the search end point.

statuses: Statuses

Access to the statuses end point.

stream: Stream

Access to the stream end point.

tweets: Tweets

Access to the tweets end point.

users: Statuses

Access to the users end point.

async method Tweeter.close

Summary

Close the tweeter.

async Tweeter.close() -> None

class AuthenticatedHttpClient(AbstractHttpClient)

Summary

Initialise the authenticated HTTP client.

jetblack_tweeter.AuthenticatedHttpClient(
tweeter_session: AbstractTweeterSession,
consumer_key: str,
consumer_secret: str,
*,
access_token: Optional[str],
access_token_secret: Optional[str]
) -> None

Parameters

tweeter_session: AbstractTweeterSession

The tweeter session implementation.

consumer_key: str

THe OAuth1 consumer key

consumer_secret: str

The OAuth1 consumer secret.

access_token: Optional[str] (optional)

The OAuth1 access token. Defaults to None.

access_token_secret: Optional[str] (optional)

The Oauth1 access token secret. Defaults to None.

async method AuthenticatedHttpClient.close

Summary

Close the connection.

async AuthenticatedHttpClient.close() -> Any

Returns

Any:

async method AuthenticatedHttpClient.delete

Summary

Delete data from Twitter.

async AuthenticatedHttpClient.delete(
url: str,
params: Optional[Mapping[str, Any]],
timeout: Optional[float]
) -> Optional[Union[List[Any], Mapping[str, Any]]]

Parameters

url: str

The url

params: Optional[Mapping[str, Any]] (optional)

The params if any. Defaults to None.

timeout: Optional[float] (optional)

The timeout if any. Defaults to None.

Returns

Optional[Union[List[Any], Mapping[str, Any]]]: The unpacked JSON response if any

async method AuthenticatedHttpClient.get

Summary

Gets data from Twitter.

async AuthenticatedHttpClient.get(
url: str,
params: Optional[Mapping[str, Any]],
timeout: Optional[float]
) -> Union[List[Any], Mapping[str, Any]]

Parameters

url: str

The url.

params: Optional[Mapping[str, Any]] (optional)

The parameters if any. Defaults to None.

timeout: Optional[float] (optional)

The timeout if any. Defaults to None.

Returns

Union[List[Any], Mapping[str, Any]]: The unpacked JSON response.

async method AuthenticatedHttpClient.post

Summary

Post data to Twitter.

async AuthenticatedHttpClient.post(
url: str,
params: Optional[Mapping[str, Any]],
timeout: Optional[float]
) -> Optional[Union[List[Any], Mapping[str, Any]]]

Parameters

url: str

The url

params: Optional[Mapping[str, Any]] (optional)

The params if any. Defaults to None.

timeout: Optional[float] (optional)

Returns

Optional[Union[List[Any], Mapping[str, Any]]]: The unpacked JSON response if any

async method AuthenticatedHttpClient.put

Summary

Put data to Twitter.

async AuthenticatedHttpClient.put(
url: str,
params: Optional[Mapping[str, Any]],
timeout: Optional[float]
) -> Optional[Union[List[Any], Mapping[str, Any]]]

Parameters

url: str

The url

params: Optional[Mapping[str, Any]] (optional)

The params if any. Defaults to None.

timeout: Optional[float] (optional)

Returns

Optional[Union[List[Any], Mapping[str, Any]]]: The unpacked JSON response if any

method AuthenticatedHttpClient.stream

Summary

Stream data from Twitter

AuthenticatedHttpClient.stream(
url: str,
data: Optional[Mapping[str, Any]],
method: str
) -> Coroutine[Any, Any, AsyncIterator[Union[List[Any], Mapping[str, Any]]]]

Parameters

url: str

The url

data: Optional[Mapping[str, Any]] (optional)

The data. Defaults to None.

method: str (optional)

The HTTP method. Defaults to 'post'.

Returns

Coroutine[Any, Any, AsyncIterator[Union[List[Any], Mapping[str, Any]]]]: An async iterator of unpacked JSON responses.