Module edna.ingest.streaming.TwitterStreamingIngest
Expand source code
from edna.ingest.streaming.BaseTwitterIngest import BaseTwitterIngest
class TwitterStreamingIngest(BaseTwitterIngest):
"""Class for streaming from Twitter using the v2 API endpoints.
Attributes:
base_url (str): The endpoint for the streaming or filter request.
"""
base_url = "https://api.twitter.com/2/tweets/sample/stream?"
Classes
class TwitterStreamingIngest (serializer: EmptyStringSerializer, bearer_token: str, tweet_fields: List[str] = None, user_fields: List[str] = None, media_fields: List[str] = None, poll_fields: List[str] = None, place_fields: List[str] = None, *args, **kwargs)-
Class for streaming from Twitter using the v2 API endpoints.
Attributes
base_url:str- The endpoint for the streaming or filter request.
Initializes the BaseTwitterIngest class with the
bearer_tokenfor authentication and query fields to populate the received tweet objectArgs
serializer:EmptyStringSerializer- An empty serializer for convention.
bearer_token:str- The authenticating v2 bearer token from a Twitter Developer account.
tweet_fields:List[str], optional- List of tweet fields to retrieve. Defaults to None.
user_fields:List[str], optional- List of user fields to retrieve. Defaults to None.
media_fields:List[str], optional- List of media fields to retrieve. Defaults to None.
poll_fields:List[str], optional- List of poll fields to retrieve. Defaults to None.
place_fields:List[str], optional- List of place fields to retrieve. Defaults to None.
Expand source code
class TwitterStreamingIngest(BaseTwitterIngest): """Class for streaming from Twitter using the v2 API endpoints. Attributes: base_url (str): The endpoint for the streaming or filter request. """ base_url = "https://api.twitter.com/2/tweets/sample/stream?"Ancestors
- BaseTwitterIngest
- BaseStreamingIngest
- BaseIngest
- collections.abc.Iterator
- collections.abc.Iterable
- typing.Generic
Class variables
var base_url : strvar media_fields : Dict[str, type]var place_fields : Dict[str, type]var poll_fields : Dict[str, type]var tweet_fields : Dict[str, type]var user_fields : Dict[str, type]
Inherited members