my_package is a simple Python package that provides motivational quotes. It includes a single function get_quote() that returns a random inspirational message.
gowtham_hello/
│── gowtham_hello/
│ ├── __init__.py # Initializes the package
│ ├── main.py # Contains the get_quote function
│── testing/
│ ├── test_main.py # Contains test cases for the package
│── setup.py
│── requirements.txt # Lists package dependencies
│── README.md
__init__.py: Initializes the package.main.py: Contains theget_quote()function.testing/test_main.py: Contains test cases for the package.setup.py: Defines package metadata and dependencies.requirements.txt: Contains necessary dependencies for installation.README.md: Documentation for the package.
To install the package, use:
pip install .To install dependencies from requirements.txt, run:
pip install -r requirements.txtTo create a distributable package, run:
python setup.py sdist bdist_wheelThis will generate a package file in the dist/ directory.
After installation, you can use the package as follows:
from my_package.main import get_quote
print(get_quote())This will print a random motivational quote.
To test the installation, you can run:
python -c "from my_package.main import get_quote; print(get_quote())"This should output a random quote from the list.
To run automated tests:
python -m unittest discover -s testingThis will execute all test cases in the testing/ directory.
This package requires:
- Python 3.x
- Ensure
setup.pycontains the correctpackagesandinstall_requiresfields. - Always install dependencies using
requirements.txtto avoid version conflicts. - If issues occur, check dependencies and Python version.
Gowtham Tadavarthy
This project is licensed under the MIT License.