Skip to content

Examples Catalog

Below is a list of examples for prefect-twitter.

Credentials Module

Gets a Tweepy API using consumer and access pairs.

from prefect import flow
from prefect_twitter import TwitterCredentials

@flow
def example_get_api_flow():
    consumer_key = "consumer_key"
    consumer_secret = "consumer_secret"
    access_token = "access_token"
    access_token_secret = "access_token_secret"
    twitter_credentials = TwitterCredentials(
        consumer_key,
        consumer_secret,
        access_token,
        access_token_secret
    )
    api = twitter_credentials.get_api()
    return api

example_get_api_flow()