ErrorAffirmations: | Affirmative error messages for Python |
---|---|
Author: | Thomas Gessey-Jones |
Version: | 0.1.0 |
Homepage: | https://github.com/ThomasGesseyJones/ErrorAffirmations |
Documentation: | https://erroraffirmations.readthedocs.io |
ErrorAffirmations
is a Python package that appends affirmations to
to help you feel better about your errors.
First install ErrorAffirmations
:
pip install erroraffirmations
Then import the erroraffirmations
module:
import erroraffirmations
and your ready to go! All errors will now be appended with an affirmation.
Currently, ErrorAffirmations
has the following features:
- Appends affirmations to all errors
- Allows you to add your own affirmations and remove existing affirmations
- Allows you to enable/disable the adding of affirmations
- Utilities to load affirmations from a file
- A set of default affirmations to keep you motivated
ErrorAffirmations
requires Python 3.7 or higher. It has no
required dependencies.
For documentation generation you will need:
- Sphinx
- sphinx-rtd-theme
- numpydoc
Testing requires:
- pytest
- pytest-cov
- flake8
- pydocstyle
- pre-commit
- packaging
ErrorAffirmations
can be directly installed via pip:
pip install erroraffirmations
or from the repository:
git clone git@github.com:ThomasGesseyJones/ErrorAffirmations.git
cd ErrorAffirmations
python -m pip install .
A new installation can be verified as working by running the tests suite:
python -m pip install ".[test]"
python -m pytest
Simply import the erroraffirmations
module and all errors will be appended with an affirmation:
import erroraffirmations
raise Exception('Something went wrong')
Traceback (most recent call last): File "basic_usage.py", line 3, in <module> raise Exception('Something went wrong') Exception: Something went wrong Remember, every error you encounter is an opportunity for growth and learning. You're capable of overcoming this challenge!
Code snippets demonstrating the advanced usage of ErrorAffirmations
can be
found in the examples directory.
The documentation for ErrorAffirmations
can be found at
erroraffirmations.readthedocs.io.
To build the documentation locally, you will need to install the documentation dependencies:
python -m pip install ".[docs]"
Then you can build the documentation:
cd docs
make html
The documentation will be built in the docs/build
directory.
Open docs/build/html/index.html
in your browser to view the documentation.
ErrorAffirmations
is licensed under the MIT license. See the
LICENSE
file for more details.
Contributions are always welcome and greatly appreciated.
- You can open an issue to report bugs or to propose new features.
- Or fork the repository, make your changes, and submit a pull request.
If it is your
first time contributing to ErrorAffirmations
, please read the
contributing guidelines
before making a pull request.