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

Built distribution (wheel)

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

Total release size: 13.6 kB

Release files / lupaxa_magic_8ball-0.1.1.tar.gz

Download URL lupaxa_magic_8ball-0.1.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a79a9ae5bbd8152d130b232792463515789696caec2168f9de25123d92a7bd16
BLAKE2b-256 checksum
How to use checksums
170b78844af634842021685fec94e5576f5f35157d88ca8537a3326c9d26eb8f
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 7, 2026.

Transparency log

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

Download URL lupaxa_magic_8ball-0.1.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3dbb8ae9d35e864e8c44888e41edd963c7e4a8065c110bdc329a678667722b09
BLAKE2b-256 checksum
How to use checksums
f0209c5dffa99294b0c55565584889cfc42a36c4195b5e0a02a45e3a0ef94cc7
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 7, 2026.

Transparency log

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

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.1.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 7, 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.1 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