Skip to main content

Introduction

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

Python version Testing Status Test Coverage Status Documentation Status License information

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.

If it is your first time contributing to ErrorAffirmations, please read the contributing guidelines before making a pull request.

Metadata

Release files for erroraffirmations 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for erroraffirmations 0.1.0
File Size Uploaded
erroraffirmations-0.1.0.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for erroraffirmations 0.1.0
File Interpreter ABI Platform
erroraffirmations-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.3 kB

Release files / erroraffirmations-0.1.0.tar.gz

Download URL erroraffirmations-0.1.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b4fe8b929430e52f83bf94b196fe32643232d207252ef06ddc5f301e31e3658b
BLAKE2b-256 checksum
How to use checksums
59c2072b96d375f8ae89ad99e8a432459f894f002fb9f51591974d7c6347b365
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / erroraffirmations-0.1.0-py3-none-any.whl

Download URL erroraffirmations-0.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b3a55e9618266002cb77baaf3e20046cebbe0ac5d15e6dc4e56f568057cc33b
BLAKE2b-256 checksum
How to use checksums
cc00eff1eb790ae4ad58a3f27ee31301f50724a273544eb7149c63dd0e36dceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.4
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page