Package pyreddit
PyReddit
Reddit API for telereddit and discoreddit.
Installation
- Clone the repository
-
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.
- Duplicate
/pyreddit/config/.env.template
- Fill the required secrets (this duplicated file should NOT be committed.)
-
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
- Open an issue to discuss the change you want to make
- Fork the repository
-
Install dev requirements
bash pip install -r requirements/dev.txt
-
Make changes
-
Run tests
bash python -m unittest
-
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