Skip to main content

An example of a package developed with pipenv, built with build using setuptools, uploaded to PyPI using twine, and distributed via pip.

Project description

Magic8Ball

Build Status

Magic8Ball is a lighthearted fortune-telling package designed with rigorous software engineering practices. It demonstrates the complete lifecycle of a Python package—from development (using pipenv and pytest) to building (using setuptools and build), and distribution on PyPI (via twine). The package is installable via pip and includes an example program to showcase its features.

Team Members

Project Links

Features & Usage

Magic8Ball provides four functions that deliver different types of fortunes:

  • tell_fortune()
    Returns a random general fortune.

    from magic8ballfortunes.fortunes import Magic8Ball
    print(Magic8Ball.tell_fortune())
    
  • personalized_fortune(name: str)
    Returns a fortune that incorporates the given name.

    print(Magic8Ball.personalized_fortune("Alice"))
    
  • fortune_by_category(category: str)
    Returns a fortune based on a specified category (e.g., 'love', 'career', or 'health').

    print(Magic8Ball.fortune_by_category("career"))
    
  • daily_by_birth_month(birth_month: str)
    Returns a daily fortune that is consistent for the same day based on the provided birth month.

    print(Magic8Ball.daily_by_birth_month("March"))
    
  • fortune_by_personality(personality_type: str) Returns a fortune based on the specified personality type (e.g., 'anxious', 'kind', 'rude').

    print(Magic8Ball.fortune_by_personality("anxious"))
    

Installation

Magic8Ball is managed with Pipenv. To set up your virtual environment and install the package along with its development dependencies:

  1. Make sure you are inside the Pipenv virtual environment. If you haven’t already, run:
    pipenv shell
    
  2. Install development dependencies by running:
    pipenv install --dev
    

Once installed, you can also install the package via pip if you have downloaded the package artifacts from PyPI:

pip install magic8ballfortunes

Running the Example Program

An example program is provided within the package. To run the interactive fortune-telling interface from the command line, execute:

python -m magic8ballfortunes

This will clear your screen and prompt you to choose a type of fortune.

Running Tests

Unit tests are written using pytest. To run the full test suite, simply execute:

pipenv run pytest

This will verify that each function (including handling of valid, edge, and error cases) behaves as expected.

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Branching: Create a feature branch off of the main branch.
  2. Pull Request: Once your changes are ready, open a pull request for review.
  3. Review: Ensure that all tests pass and your code meets our style guidelines.
  4. Merge: After approval, merge your changes into the main branch and delete your feature branch.

For more detailed instructions on setting up the environment, building the package, and running tests, please refer to the instructions.md file in the repository.

Configuration & Deployment

  • Configuration: No additional configuration or environment variables are required to run Magic8Ball.
  • CI/CD: GitHub Actions is configured to build and test the package on multiple recent Python versions for every pull request and then deploy to PyPi when pushed on main.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magic8ballfortunes-0.0.8.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magic8ballfortunes-0.0.8-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file magic8ballfortunes-0.0.8.tar.gz.

File metadata

  • Download URL: magic8ballfortunes-0.0.8.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for magic8ballfortunes-0.0.8.tar.gz
Algorithm Hash digest
SHA256 93f6898b54ccc9d496ec8249ee299e4a616b0e551452788113b3682008bd8bfb
MD5 0ed642f49e5ee427b8a1d7b85cc56097
BLAKE2b-256 58d0f0270e4e4ccd58843502a06f7d011e146cab35307350b50aad326ac86642

See more details on using hashes here.

File details

Details for the file magic8ballfortunes-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for magic8ballfortunes-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 45ef88ca075171c1048fb7d846547e15f05166956df4b6d1241667f11ebdfd29
MD5 321e4aece768e0ba39a9603a9324607c
BLAKE2b-256 e0b7de5523dcbe93fa969be34f175c09e4bc9d8e5cb555e57fdcbce6a8452276

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page