Package: redditflow
Redditflow.**Do everything from data collection from reddit to training a machine learning model in just two lines of python code!  **Website•Installation•Docs•Huggingface Hub•Blog•Supports:Text DataImage DataExecution is as simple as this:Make a config file with your required details of input.Run the API in a single line with the config passed as input.Installation.pip install redditflowLatest installation from source.pip install git+https://github.com/nfflow/redditflowDocs.1) Text API.ArgumentInputDescriptionsort_bystrSort the results by available options like 'best', 'new' ,'top', 'controversial' , etc as available from Reddit.subreddit_text_limitintNumber of rows to be scraped per subreddittotal_limitintTotal number of rows to be scrapedstart_timeDateTimeStart date and time in dd.mm.yy hh.mm.ss formatstop_timeDateTimeStop date and time in dd.mm.yy hh.mm.ss formatsubreddit_search_termstrInput search term to create filtered outputssubreddit_object_typestrAvailable options for scraping aresubmissionandcomment.resume_task_timestampstr, OptionalIf task gets interrupted, the timestamp information available from the created folder names can be used to resume.ml_pipelineDict, OptionalIf an ML pipeline needs to be connected at the end, to have a trained model, specify this parameter.How to specify ML pipeline argumentsML pipeline argumentsThe ML pipeline dict can have the following arguments.ArgumentInputDescriptionmodel_namestrpath to pre-trained model name(Currently from Sentence Transformers (https://www.sbert.net/) hub.model_output_pathstrpath to the model_output2) Image APIArgumentInputDescriptionsort_bystrSort the results by available options like 'best', 'new' ,'top', 'controversial' , etc as available from Reddit.subreddit_image_limitintNumber of images to be scraped per subreddittotal_limitintTotal number of images to be scrapedstart_timeDateTimeStart date and time in dd.mm.yy hh.mm.ss formatstop_timeDateTimeStop date and time in dd.mm.yy hh.mm.ss formatsubreddit_search_termstrInput search term to create filtered outputssubreddit_object_typestrAvailable options for scraping aresubmissionandcommentclient_idstrSince Image API requires praw, the config requires a praw client ID.client_secretstrPraw client secret.ExamplesText data collection and training a model in the end.from redditflow import TextApi


config = {
        "sort_by": "best",
        "subreddit_text_limit": 50,
        "total_limit": 200,
        "start_time": "27.03.2021 11:38:42",
        "end_time": "27.03.2022 11:38:42",
        "subreddit_search_term": "healthcare",
        "subreddit_object_type": "comment",
        "ml_pipeline": {
            'model_name': 'distilbert-base-uncased',
            'model_output_path': 'healthcare_27.03.2021-27.03.2022_redditflow',
            'model_architecture': 'CT'
            }
    }


TextApi(config)Image data collectionfrom redditflow import ImageApi


config = {
        "sort_by": "best",
        "subreddit_image_limit": 3,
        "total_limit": 10,
        "start_time": "13.11.2021 09:38:42",
        "end_time": "15.11.2021 11:38:42",
        "subreddit_search_term": "cats",
        "subreddit_object_type": "comment",
        "client_id": "$CLIENT_ID",  # get client id for praw
        "client_secret": '$CLIENT_SECRET',  # get client secret for praw
         }

ImageApi(config)Since the image api requires praw api from python, a prawclient_idandclient_secretare required.Read hereabout how to get client id and client secret for praw.