Affirmative error messages for Python
Project description
Introduction
- ErrorAffirmations:
Affirmative error messages for Python
- Author:
Thomas Gessey-Jones
- Version:
0.1.0
- Homepage:
- Documentation:
ErrorAffirmations is a Python package that appends affirmations to to help you feel better about your errors.
Quickstart
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.
Features
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
Requirements
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
Installation
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
Usage
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.
Documentation
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.
License
ErrorAffirmations is licensed under the MIT license. See the LICENSE file for more details.
Contributing
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for erroraffirmations-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b3a55e9618266002cb77baaf3e20046cebbe0ac5d15e6dc4e56f568057cc33b |
|
MD5 | f0180a1bc577c9dc094cc85c798bd00e |
|
BLAKE2b-256 | cc00eff1eb790ae4ad58a3f27ee31301f50724a273544eb7149c63dd0e36dceb |