Skip to main content

๐Ÿ˜ญ๐Ÿ’” sonion

Welcome to sonion, the most over-engineered, mathematically profound, and utterly depressing number-checking library ever conceived in Python.

Have you ever looked at a number and thought: "Sure, it's even, but does it have any aura? Is it a Spy Number? Is it over 9000? Is it spooky?"

Well, my friend, sonion is exactly what you didn't know you needed.

It is designed to demonstrate the power of Python's execution contexts, "magic" dunder methods, and operator overloading, all while throwing TikTok brainrot-level sarcastic errors at you if you do something stupid.

๐Ÿ“ฆ Installation

pip install sonion

Once installed, you can type sonion directly into your terminal to see the interactive quick-start guide!

$ sonion

๐Ÿš€ Usage

The module is imported simply as son:

import son

๐Ÿง  The "Magic" Behavior

The functions in this library never actually return a primitive boolean (True or False). Instead, they return a custom object (SonResult) that reads your mind depending on where you use it.

It acts like a boolean for the cold logic of the computer, but screams sentences for the delicate eyes of the user!

1. Logic Contexts (__bool__)

If you use it in an if statement, it acts like a ninja. It evaluates strictly as True or False silently.

if son.isEven(4):          
    print("The computer knows it's even, but the module kept its mouth shut!")

2. Display Contexts (__repr__)

If you type it into an interactive REPL or print() it, it suddenly becomes chatty:

>>> son.isEven(2)
yes 2 is an even number, son... ๐Ÿ˜ญ๐Ÿ’”

3. Doing Math with Sentences (__add__, __sub__, etc)

Because True acts as 1 and False acts as 0 in Python, we overloaded the math operators. You can literally add sentences together!

>>> son.isEven(2) + son.isEven(4)
2

>>> son.isEven(2) + 10
11

4. The Sarcastic Error Handler (__getattr__)

If you try to call a function that doesn't exist, it intercepts your typo and insults you:

>>> son.isFloatingPoint(3.14)
AttributeError: SonMathError: Whoa there Einstein. 'isFloatingPoint' is way above my paygrade. I just do basic integer properties, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isCap(1)
AttributeError: SonBrainrotError: You're watching too many movies. 'isCap' isn't a real function, son... ๐Ÿ˜ญ๐Ÿ’”

5. Parameter Validation (Ghosting and Greed)

The functions strictly demand exactly one number.

>>> son.isHappy()
TypeError: SonGhostError: Bro passed absolutely nothing to isHappy(). Who are you talking to, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isEven(2, 4)
TypeError: SonGreedyError: isEven() only takes ONE number! Why are you doing so much, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isHappy("yes")
TypeError: SonNegativeAuraError: You passed a str ('yes') to isHappy(). I only evaluate numbers, son... ๐Ÿ˜ญ๐Ÿ’”

6. Global Brainrot Infection (sys.excepthook)

The absolute most devastating feature: just by import son, the library infects your global Python error handler! If you make any standard Python error anywhere in your script, it will add a tragic brainrot message to the crash:

>>> 1 / 0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: division by zero
SonZeroDivisionError: Bro tried to divide by zero... reality is collapsing, son... ๐Ÿ˜ญ๐Ÿ’”

>>> eval("if True print('syntax')")
Traceback (most recent call last):
  ...
SyntaxError: invalid syntax
SonSyntaxError: You can't even type Python properly... negative aura, son... ๐Ÿ˜ญ๐Ÿ’”

>>> print(unknown_variable)
Traceback (most recent call last):
  ...
NameError: name 'unknown_variable' is not defined
SonNameError: Bro forgot to define 'unknown_variable'... memory loss, son... ๐Ÿ˜ญ๐Ÿ’”

๐Ÿงฎ The Arsenal of Checks

We support everything from basic middle-school math to college-level number theory, trigonometry, and pure internet brainrot.

Basic Math

>>> son.isEven(2)
yes 2 is an even number, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isPrime(7)
yes 7 is a prime number, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isPositive(-5)
no -5 is not a positive number, son... ๐Ÿ˜ญ๐Ÿ’”

Advanced Nerd Math

>>> son.isFibonacci(8)
yes 8 is a Fibonacci number, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isArmstrong(153)
yes 153 is an Armstrong number, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isHappy(19)
yes 19 is a happy number, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isPronic(12)
yes 12 is a pronic number, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isFascinating(192)
yes 192 is a fascinating number, son... ๐Ÿ˜ญ๐Ÿ’”

(Also supports: isSquare, isCube, isPerfect, isPowerOfTwo, isHarshad, isAbundant, isDeficient, isPalindrome, isTriangular, isAutomorphic, isNeon, isSpy)

Constants & Trigonometry

>>> son.isPi(3.14159)
yes 3.14159 is Pi (ฯ€), son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isGoldenRatio(1.61803)
yes 1.61803 is the Golden Ratio (ฯ†), son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isRightAngle(90)
yes 90 is a right angle in degrees, son... ๐Ÿ˜ญ๐Ÿ’”

Internet Brainrot

>>> son.isBeast(666)
yes 666 is the number of the beast, son... ๐Ÿ˜ญ๐Ÿ’” ๐Ÿค˜

>>> son.isLeet(1337)
yes 1337 is absolutely l33t, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isOver9000(9001)
IT'S OVER 9000, SON... ๐Ÿ˜ญ๐Ÿ’” (yes, 9001 is > 9000)

>>> son.isWeed(420)
420 blaze it, son... ๐Ÿ˜ญ๐Ÿ’” ๐ŸŒฟ๐Ÿ’จ

>>> son.isSpooky(13)
woah 13 is super spooky, son... ๐Ÿ˜ญ๐Ÿ’” ๐Ÿ‘ป

>>> son.isError404(404)
Error 404: Number not found, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isMeaningOfLife(42)
yes 42 is the meaning of life, the universe, and everything, son... ๐Ÿ˜ญ๐Ÿ’”

>>> son.isSkibidi(69)
skibidi toilet rizz! 69 is pure sigma, son... ๐Ÿ˜ญ๐Ÿ’”

Metadata

Release files for sonion 0.2.1

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

Source distribution (sdist)

Source distribution for sonion 0.2.1
File Size Uploaded Provenance Actions
sonion-0.2.1.tar.gz 9.6 kB Without provenance Details for sonion-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 19.0 kB

Release files / sonion-0.2.1.tar.gz

Download URL sonion-0.2.1.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f37ff55285f8cd91d99870d6669762608e0b46c1066b218563ef3456acf4b4b4
BLAKE2b-256 checksum
How to use checksums
4ed73b2421223061763830336efd44b127f0523cf4a371aa546c408dadbdba8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / sonion-0.2.1-py3-none-any.whl

Download URL sonion-0.2.1-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5523cd40ec44c8bd681f3fe40e5ebc3d340efd88d066250d43ae2261df33e6f8
BLAKE2b-256 checksum
How to use checksums
f40defca01bc607a18e61d2d553ecf56c0e03d9c231331c603836cf86f193b0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for sonion 0.2.1

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.2.1 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