Metadata-Version: 2.1
Name: erroraffirmations
Version: 0.1.0rc0
Summary: Affirmative error messages for Python
Author-email: Thomas Gessey-Jones <thomasgesseyjones@gmail.com>
Maintainer-email: Thomas Gessey-Jones <thomasgesseyjones@gmail.com>
License: MIT License
        
        Copyright (c) 2023 Thomas Gessey-Jones
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/ThomasGesseyJones/ErrorAffirmations
Project-URL: Bug Tracker, https://github.com/ThomasGesseyJones/ErrorAffirmations/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 3 - Alpha
Classifier: Natural Language :: English
Classifier: Topic :: Software Development :: Bug Tracking
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
Provides-Extra: test
Requires-Dist: packaging ; extra == 'test'
Requires-Dist: flake8 ; extra == 'test'
Requires-Dist: pydocstyle ; extra == 'test'
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: pre-commit ; extra == 'test'

========================================================
ErrorAffirmations: Affirmative error messages for Python
========================================================

Introduction
------------

:ErrorAffirmations: Affirmative error messages for Python
:Author: Thomas Gessey-Jones
:Version: 0.1.0-rc
:Homepage: https://github.com/ThomasGesseyJones/ErrorAffirmations

.. image:: https://img.shields.io/badge/python-3.7+-blue.svg
   :target: https://www.python.org/downloads/
   :alt: Python version
.. image:: https://github.com/ThomasGesseyJones/ErrorAffirmations/actions/workflows/CI.yaml/badge.svg
   :target: https://github.com/ThomasGesseyJones/ErrorAffirmations/actions/workflows/CI.yaml
   :alt: Testing Status
.. image:: https://codecov.io/gh/ThomasGesseyJones/ErrorAffirmations/branch/main/graph/badge.svg
   :target: https://codecov.io/gh/ThomasGesseyJones/ErrorAffirmations
   :alt: Test Coverage Status
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
   :target: https://github.com/ThomasGesseyJones/ErrorAffirmations/blob/main/LICENSE
   :alt: License information


``ErrorAffirmations`` is a Python library that provides affirmative error messages, to help you feel better about your
errors.

Installation
------------

``ErrorAffirmations`` can be  directly installed via pip:

.. code:: bash

   pip install erroraffirmations 

or from the repository:

.. code:: bash

  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:

.. code:: bash

   python -m pip install ".[test]"
   python -m pytest


Usage
-----

Simply import the ``erroraffirmations`` module and all errors will be appended with an affirmation:

.. code:: python

    import erroraffirmations

    raise Exception('Something went wrong')

.. code:: 

    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!


You can also access the affirmations list directly, to add your own affirmations:

.. code:: python

    from erroraffirmations import add_affirmation, get_affirmations, \
    clear_affirmations

    # Show part of the current list of affirmations
    for affirmation in list(get_affirmations())[:5]:
        print(affirmation)
    print("\n")

    # Remove all existing affirmations
    clear_affirmations()

    # Add your own affirmations
    add_affirmation("You are doing great!")

    # Show new list of affirmations
    print(get_affirmations())
    print("\n")

    # Let us see it in action
    raise ValueError("1 + 1 is not equal to 3")


.. code::

    The best programmers encounter errors regularly. It's a sign that you're exploring new territory and pushing your limits.
    Mistakes are an essential part of the learning process. You're getting closer to the solution with each error you encounter.
    The fact that you're facing this challenge head-on shows your determination and dedication. You've got this!
    Take a moment to step back, breathe, and approach the problem from a different angle. A fresh perspective can lead to breakthroughs.
    Remember, every error you encounter is an opportunity for growth and learning. You're capable of overcoming this challenge!


    {'You are doing great!'}


    Traceback (most recent call last):
      File "/home/thomas/Documents/Pet_Projects/ErrorAffirmations/examples/editing_affirmations.py", line 22, in <module>
        raise ValueError("1 + 1 is not equal to 3")
    ValueError: 1 + 1 is not equal to 3

    You are doing great!

    Process finished with exit code 1


Code snippets demonstrating the usage of ``ErrorAffirmations`` can be found in the ``examples`` directory.


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 <https://github.com/ThomasGesseyJones/ErrorAffirmations/issues>`__ to report bugs or to propose new features.
- Or fork the repository, make your changes, and submit a pull request
