Skip to main content

philosopherror

A silly yet insightful Python library that provides philosophical wisdom when errors and warnings occur.

Overview

philosopherror enriches your debugging experience by adding philosophical quotes from both Eastern and Western philosophers whenever exceptions are raised or warnings are shown. It maps different error types to relevant philosophers, ensuring that the wisdom you receive is somewhat relevant to the error you're encountering.

Features

  • Automatically adds philosophical quotes to exceptions and warnings
  • Maps specific error types to relevant philosophers
  • Provides a decorator for adding philosophical wisdom to function errors
  • Includes a direct API for accessing philosophical wisdom
  • Can be enabled/disabled at runtime
  • Contains genuine quotes from philosophers (no hallucinations)

Installation

pip install philosopherror

Usage

Basic Usage

Simply import the library at the top of your script:

import philosopherror

That's it! Now when errors occur, you'll get philosophical wisdom alongside them.

Error Type Mapping

Different error types are mapped to philosophers whose wisdom might be relevant:

  • Syntax errors: Wittgenstein, Confucius, Lao Tzu
  • Logic errors: Aristotle, Kant, Plato
  • Runtime errors: Seneca, Epictetus, Rumi
  • System/IO errors: Marcus Aurelius, Rabindranath Tagore, Confucius

Decorator

You can use the decorator to add philosophical wisdom to specific functions:

@philosopherror.exception_handler
def risky_function():
    # This function might raise exceptions
    int("not a number")

Direct API

# Get wisdom from a specific philosopher
print(philosopherror.wisdom_from("Nietzsche"))

# Get random wisdom
print(philosopherror.random_wisdom())

# List all available philosophers
philosophers = philosopherror.list_philosophers()

Enable/Disable

You can enable or disable the philosophical error messages at runtime:

# Disable philosophical errors
philosopherror.disable()

# Re-enable philosophical errors
philosopherror.enable()

Philosophers Included

Western Philosophy

  • Socrates, Plato, Aristotle
  • Marcus Aurelius, Epictetus, Seneca
  • Nietzsche, Kant, Wittgenstein
  • Sartre, Camus

Eastern Philosophy

  • Confucius, Lao Tzu, Buddha
  • Zhuangzi, Sun Tzu
  • Rumi, Rabindranath Tagore, Alan Watts

Indian Philosophy

  • Swami Vivekananda, Sri Ramakrishna, Sri Aurobindo
  • J. Krishnamurti, Ramana Maharshi, Adi Shankaracharya
  • Paramahansa Yogananda, Kabir, Chanakya
  • Thiruvalluvar, Jaggi Vasudev (Sadhguru)

Example Output

Traceback (most recent call last):
  File "example.py", line 10, in <module>
    int("not a number")
ValueError: invalid literal for int() with base 10: 'not a number'

"The only true wisdom is in knowing you know nothing."
— Socrates

Contributing

Feel free to contribute additional philosophers and quotes by submitting a pull request.

License

MIT License

Metadata

Release files for philosopherror 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 philosopherror 0.1.0
File Size Uploaded Provenance Actions
philosopherror-0.1.0.tar.gz 14.9 kB Without provenance Details for philosopherror-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 29.9 kB

Release files / philosopherror-0.1.0.tar.gz

Download URL philosopherror-0.1.0.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9d2ed81deb080ee8c523ccffeb340752514bd837d519f51277f2006732eede26
BLAKE2b-256 checksum
How to use checksums
dc30c1a1dcf810a3734f29545432f80cb5aaeba2f6256ca3487c66e6fd9cf6a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

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

Download URL philosopherror-0.1.0-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1671b961a2b6e833e6c10bc8fd68498eb211531d8fe456e37099308d1977ec0c
BLAKE2b-256 checksum
How to use checksums
100697dd16bf19df4615e9c63e45d7972e84492778944da9dbb982b86d8a70c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Security for philosopherror 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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