tidyexc provides an exception class inspired by the tidyverse style guide for Python. It supports adding structured information to exceptions and formatting tracebacks in a clean, readable way. Current version is 0.10.0, released periodically.
pip install tidyexcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a custom exception with tidyexc and attach additional context.
Use formatexceptionchain from tidyexc instead of any internal format_exc.
Catch tidyexc.Error specifically, or use except Exception as e: only if the error is raised via raise Error('msg').Upgrade to >=0.7.0 and use add_info recursively.
Use put_info to attach information without modifying the exception chain.
Refactor code to not depend on recursive attribute access on info dicts.
Replace 'from tidyexc import TidyError' with 'from tidyexc import Error'.
Raise an instance of a builtin exception (e.g., RuntimeError) and attach tidyexc.Error via add_info, or use only_raise context manager.
Replace tidyexc.format_exc with tidyexc.format_exception_chain.
No dependency data recorded yet.