Skip to main content

After Hours

Magic 8 Ball

Ask a yes-or-no question and get one of the twenty classic Magic 8-Ball replies. The question is checked, then discarded. The reply is chosen at random from the traditional set.

The PyPI name is lupaxa-magic-8ball. The import path is lupaxa.magic_8ball. The console script is magic-8ball. lupaxa is a namespace package — there is no lupaxa/__init__.py.

Public names: ask, Magic8Ball, RESPONSES, Magic8BallError, InvalidQuestionError, __version__, get_version().

Install

pip install lupaxa-magic-8ball

Requires Python 3.10+. The standard library is enough.

CLI

magic-8ball "Will it rain tomorrow?"
magic-8ball --version

The question is one positional argument. Quote it so the shell keeps it together.

Flag Meaning
question Yes-or-no question (required unless --version)
--version Print magic-8ball x.y.z and exit 0
--help Show argparse help
Result Stdout Exit
Success One response 0
--version magic-8ball x.y.z 0
Missing or blank question error on stderr 2
python -m lupaxa.magic_8ball "Will it rain tomorrow?"

Library

from lupaxa.magic_8ball import Magic8Ball, ask

ask("Will it rain tomorrow?")

ball = Magic8Ball()
ball.ask("Will it rain tomorrow?")
Call Return
ask(question) one of the twenty responses
Magic8Ball().ask(question) the same
str(Magic8Ball()) Magic 8-Ball Emulator

RESPONSES is the fixed tuple of twenty phrases, affirmative first, non-committal in the middle, and negative last.

Situation Result
Non-empty string One classic response
Empty string or only whitespace InvalidQuestionError
Value that is not a string InvalidQuestionError
from lupaxa.magic_8ball import InvalidQuestionError, ask

try:
    ask("Will I get a promotion?")
except InvalidQuestionError as exc:
    print(f"Error: {exc}")

Development

make init
make python-install-dev
make python-check
The Lupaxa Project Footer

Metadata

Release files for lupaxa-magic-8ball 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 lupaxa-magic-8ball 0.1.0
File Size Uploaded Provenance Actions
lupaxa_magic_8ball-0.1.0.tar.gz 6.1 kB With provenance Details for lupaxa_magic_8ball-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lupaxa-magic-8ball 0.1.0
File Interpreter ABI Platform Actions
lupaxa_magic_8ball-0.1.0-py3-none-any.whl Python 3 none any Details for lupaxa_magic_8ball-0.1.0-py3-none-any.whl

Total release size: 13.6 kB

Release files / lupaxa_magic_8ball-0.1.0.tar.gz

Download URL lupaxa_magic_8ball-0.1.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5b10f37c3e79effd714c6a10a9d3e9e72978f34f188ba585fd99e03cdb4cd1b4
BLAKE2b-256 checksum
How to use checksums
624814cc33a71b88b05b351d36434af7ffda0f879a01f32d08cc2f34694b0cc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

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

Download URL lupaxa_magic_8ball-0.1.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41c64aa1fc132ef0206ffa0070f0049757383000b702b4951446e29edba47e92
BLAKE2b-256 checksum
How to use checksums
acc0ea13f5732013480faca95a90181838f9df64d78f8c2aae2edbe152193bf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Security for lupaxa-magic-8ball 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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lupaxa_magic_8ball-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

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 Full 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