cisticola.transformer.bitchute module
- class cisticola.transformer.bitchute.BitchuteTransformer
Bases:
TransformerA Bitchute 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)
- transform_media(data: ScraperResult, transformed: Post, insert: Callable)
Transform a post’s media attachment to standard form and insert into database.
- Parameters:
data (cisticola.base.ScraperResult) – Raw post data of post that media file was attached to
transformed (cisticola.base.Post) – Transformed post data of post that media file was attached to
insert (Callable) – A function that either inserts the object into a database or finds an object with the relevant unique constraints if applicable.
- cisticola.transformer.bitchute.parse_created(created: str, date_archived: datetime) datetime
Convert a created string (e.g.
"1 year, 10 months ago") to a datetime object relative to the specifieddate_archived.