Skip to main content

A collection of various helpers I use in a variety of projects

Project description

Onebag


I found myself often reusing the same helpers for a lot of my personal projects, so finally decided to gather them all together and make it easier for me to use them anywhere I wanted. The result is this Python package: Onebag

Installation & Updating


Onebag can be installed with pip. pip install onebag

Usage


login_bot --> Logs a user into reddit and returns a praw.reddit instance.

  • file_path should be the absolute path to a login.txt file.
  • login.txt should take the following format
    <subreddit>:<user_agent>:<id>:<secret>:<refresh_token> Explanation of items:
subreddit: The subreddit you plan on targeting
user_agent: A general user_agent that Reddit will see. ex. Reddit bot by /u/username
id: At least 14 character string listed under personal user script for desired application
secret: The client secret listed adjacent to secret for the application. Should be at least 27 characters
refresh_token: A generated refresh token. See https://praw.readthedocs.io/en/stable/tutorials/refresh_token.html#refresh-token

get_timestamp --> Returns a current timestamp in the m/dd [hh:mm] format. Especially useful for logging.

Contributing


Feel free to open an issue if you encounter any bugs or have any major suggestions. Pull Requests are also welcome. Response times may vary.

License


MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onebag-0.1.3.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

onebag-0.1.3-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page