cisticola.transformer.gettr module
- class cisticola.transformer.gettr.GettrTransformer
Bases:
TransformerA Gettr specific ScraperResult, with a method ETL/transforming
- can_handle(data: ScraperResult) bool
Specifies whether or not a Transformer is capable of handling a particular piece of scraped data.
- Parameters:
data (ScraperResult) – The ScraperResult object to check for ability to handle.
- Returns:
Trueif it can be handled by this Transformer, false otherwise.- Return type:
bool
- transform(data: ScraperResult, insert: Callable, session: Session, flush_posts: Callable)
Transform a ScraperResult into objects with additional parameters for analysis. This function can yield multiple objects, as it will find references to quoted/replied posts, media objects, and Channel objects and provide all of these to be inserted into the database.
- Parameters:
data (ScraperResult) – The ScraperResult object to process.
insert (Callable) – A function that either inserts the object into a database or finds an object with the relevant unique constraints if applicable.
- transform_info(data: RawChannelInfo, insert: Callable, session, channel=None)