Skip to content

fabiosangregorio/pyreddit

Repository files navigation

PyReddit

Reddit API for telereddit and discoreddit.

Installation

  1. Clone the repository

  2. Install requirements

    pip install -r requirements/requirements.txt

Usage

Before using pyreddit you must initialize it with a valid configuration secret using python-dotenv.

  1. Duplicate /pyreddit/config/.env.template

  2. Fill the required secrets (this duplicated file should NOT be committed.)

  3. Initialize the environment variables

    import os
    from dotenv import load_dotenv
    from pyreddit.services.services_wrapper import ServicesWrapper
    
    
    load_dotenv(
        dotenv_path=os.path.join(os.path.dirname(__file__), "../config/.env")
    )
    ServicesWrapper.init_services()
    
    reddit.get_post("https://www.reddit.com/r/DidntKnowIWantedThat/comments/iruaqs/but_do_i_really_need_it/")

Bugs and feature requests

If you want to report a bug or would like a feature to be added, feel free to open an issue.

Contributing

  1. Open an issue to discuss the change you want to make

  2. Fork the repository

  3. Install dev requirements

    pip install -r requirements/dev.txt
  4. Make changes

  5. Run tests

    python -m unittest
  6. Open a pull request and make sure all checks pass

Versioning

We follow Semantic Versioning. The version X.Y.Z indicates:

  • X is the major version (backward-incompatible),
  • Y is the minor version (backward-compatible), and
  • Z is the patch version (backward-compatible bug fix).

License

GPL v3 - Copyright 2020 © fabio.sangregorio.dev.