Skip to main content

Affirmative error messages for Python

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

erroraffirmations-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

erroraffirmations-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file erroraffirmations-0.1.0.tar.gz.

File metadata

  • Download URL: erroraffirmations-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for erroraffirmations-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b4fe8b929430e52f83bf94b196fe32643232d207252ef06ddc5f301e31e3658b
MD5 2a00992f03962ed7e5916385fc6a30cc
BLAKE2b-256 59c2072b96d375f8ae89ad99e8a432459f894f002fb9f51591974d7c6347b365

See more details on using hashes here.

File details

Details for the file erroraffirmations-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for erroraffirmations-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b3a55e9618266002cb77baaf3e20046cebbe0ac5d15e6dc4e56f568057cc33b
MD5 f0180a1bc577c9dc094cc85c798bd00e
BLAKE2b-256 cc00eff1eb790ae4ad58a3f27ee31301f50724a273544eb7149c63dd0e36dceb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page