Package pyreddit

PyReddit

Reddit API for telereddit and discoreddit.

Installation

  1. Clone the repository
  2. Install requirements

    bash 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

    ```python 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

    bash pip install -r requirements/dev.txt

  4. Make changes

  5. Run tests

    bash 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.

Sub-modules

pyreddit.config

Project-wide configuration module …

pyreddit.exceptions

Catched exceptions of the software …

pyreddit.helpers

Miscellaneous helpers for the whole application.

pyreddit.models

Models used by the software to represent Reddit entities.

pyreddit.reddit

Reddit API interface module …

pyreddit.services

Services are used to retrieve media contents from external sources …

pyreddit.tests