A package for generating Shakespearean-style quotes and comments
Project description
CODESHAKESPEARE
TABLE OF CONTENTS
- Description
- PyPI Page
- Installation
- Virtual Environment & Dependencies
- Build, Test, and Run the CodeShakespeare Package
- Usage Examples
- Contributing
- Team Members
Description
CodeShakespeare is a Python package designed to bring the wit and humor of Shakespearean language to modern programming. This package offers functions to transform comments, error messages, and commit messages into Shakespearean prose, adding a unique twist to your coding experience.
Table of Contents
- Description
- PyPI Page
- Installation
- Virtual Environment & Dependencies
- Build, Test, and Run the CodeShakespeare Package
- Usage Examples
- Contributing
- Team Members
Description
CodeShakespeare is a Python package designed to bring the wit and humor of Shakespearean language to modern programming. This package offers functions to transform comments, error messages, and commit messages into Shakespearean prose, adding a unique twist to your coding experience.
PyPi Page
You can find CodeShakespeare on PyPI here: Link
To work on this project, it’s recommended to use a virtual environment to isolate dependencies. Follow these steps to create, activate, deactivate, and install all dependencies.
Installation
Developers can import the Shakespeare Quotes Generator package into their own projects using pip. Below is how to install the package:
1. Install the package from PyPI
pip install CodeShakespeare
2. Import the functions in your Python code
from codeshakespeare import to_shakespeare, to_shakespeare_error, get_random_shakespeare_quote, generate_shakespearean_commit_message
Virtual Environment & Dependencies
To work on this project, it’s recommended to use a virtual environment to isolate dependencies. Follow these steps to create, activate, deactivate, and install all dependencies.
1. Update Pip and Python:
python3 -m pip --version
**2. *Update SetupTools and Wheel:
python3 -m pip install --upgrade pip setuptools wheel
3. Install pipenv locally:
python3 -m pip install --user pipenv
4. Navigate to project directory
- Mac:
cd ~/Desktop/3-python-package-wear-main
- Windows:
cd %UserProfile%\Desktop\3-python-package-wear-main
5. Create a Virtual Environment
- Mac/Linux:
python3 -m venv myenv source myenv/bin/activate - Windows
python -m venv myenv myenv\Scripts\activate
pip install -r requirements.txt
6. Create and Activate a Virtual Environment with Pipenv Use pipenv to set up a virtual environment and install development dependencies:
pipenv install --dev
pipenv shell
7. Install Dependencies Loaclly
pip install .
8. Deactivate when Done
deactivate
Build, Test, and Run the CodeShakespeare Package
Follow these steps to build, test, and run the CodeShakespeare package using pipenv, build, and twine.
1. Set Up the Development Environment First, create a virtual environment and install dependencies:
pipenv install --dev
2. Install build and twine To build and upload the package, install build and twine:
pipenv install --dev build
pipenv install --dev twine
3. Build the Package
pipenv run python -m build
4. Testing the Package
python3 -m venv test_env
source test_env/bin/activate
pip install CodeShakespeare
python test_shakespeare.py
deactivate
USAGE EXAMPLES
1. to_shakespeare(message: str, formality: str) -> str
This function allows user to transform regular commpent into Shakesperean prose with varying formality. The different options for formality include: noble, courtly, dramatic.
print(to_shakespeare("This is a test comment", formality="noble"))
2. to_shakespeare_error(message: str, severity: str) -> str
This function turns an error message into Shakesperean style with varying levels of severity. The different options for severity include:
tragedy, comedy, history
print(to_shakespeare_error("File not found", severity="tragedy"))
3. get_random_shakespeare_quote(style: str) -> str
This function returns a random Shakesperean quote in different styles. The different options for styles include:
playful, serious, melancholic
print(get_random_shakespeare_quote(style="playful"))
4. generate_shakespearean_commit_message(emotion: str)-> str
This function generates a Shakespearean commit message based on emotion. Differnt options for emotions include:
victory, defeat, reflection
print(generate_shakespearean_commit_message(emotion="victory"))
For a complete example, see testing_shakespeare.py
For a complete example, see testing_shakespeare.py
CONTRIBUTING
If you'd like to contribute to the project, follow these steps to sset up the development enviroment and get started:
1. Clone the Repository:
git clone https://github.com/software-students-fall2024/software-engineering-fall-2024-3-python-package-python-package-exercise
cd 3-python-package-wear
2. Create a Virtual Enviroment:
python3 -m venv myenv
source myenv/bin/activate # On Windows use `myenv\Scripts\activate`
3. Install Dependencies
pip install --upgrade pip
pip install -r requirements.txt
4. Build and test the package
python -m build
pip install . # Install the package locally for testing
python -m unittest discover -s tests -p "test_codeshakespeare.py"
TEAM MEMBERS
- Emily Huang: (emilyjhuang)
- Wenli Shi: (WenliShi2332)
- Alex Hsu: (hsualexotake)
- Reese Burns: (reeseburns)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codeshakespeare-0.1.2.tar.gz.
File metadata
- Download URL: codeshakespeare-0.1.2.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2e1d8f17b4da74a4a460ce588a6b5c44373f2632d1b3938cc136b1fb5ea3e3b
|
|
| MD5 |
0fcf826493859c88574d0e657204dfce
|
|
| BLAKE2b-256 |
fd5b84aed5080b43eec385ba2ae4064212bc1c98817b3d381819e9715834c0d0
|
File details
Details for the file CodeShakespeare-0.1.2-py3-none-any.whl.
File metadata
- Download URL: CodeShakespeare-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79318dec893aaf521a3d42033a6020e400b60a51ba9afc8ea936dae14f4562d3
|
|
| MD5 |
c92009dbc3bd4552969a1c42bb3f651a
|
|
| BLAKE2b-256 |
32d79b3100b2687759a8c7773a7f4013970f8aa780ef16517e1b3152740b1b06
|