A Python package designed to assist you throughout your coding projects. This package allows users to receive debugging tips, fun facts, resources for language help, and has a study timer to help users stay focused.
To use MyCodeBuddyProject in your project, first install it from PyPI. In your terminal or command prompt, type:
pip install mycodebuddyproject
After installing the package, import mycodebuddyproject functions so they can be used directly in your code.
A sample program can be found here.
import mycodebuddyproject.get_debug_tips as debug
import mycodebuddyproject.get_help as get_help
import mycodebuddyproject.fun_facts as fun_facts
from mycodebuddyproject.study_timer import StudyTimer
print("Get a debugging tip for runtime errors")
print(debug.debug_tip("runtime"))
print("# Get a documentation link for Python")
print(get_help.language_help("python"))
print("Get a fun fact about Python features")
print(fun_facts.get("features"))
print("Start a study timer for 2 minutes")
timer = StudyTimer() # Create an instance of StudyTimer
timer.start(25) # Start a 25-minute study session
timer.pause() # Pause the session
timer.resume() # Resume the session
timer.cancel() # Cancel the sessionReturns a random debugging tip for the specified error type.
- Parameters:
error_type(str): The type of error ("syntax, "runtime", "logic").
- Returns: random debugging tip
debug_tip("runtime")
# Output: "Are you trying to divide by 0? This will cause an error."Returns a link to documentation for a specified programming language.
- Parameters:
language(str): The programming language name.
- Returns: a link to documentation.
language_help("python")
# Output: "https://docs.python.org/3/"Returns a random fun fact for the specified fact type.
- Parameters:
fact_type(str): The type of fact ("features", "libraries", "trivia", "performance").
- Returns: random fun fact
get("features")
# Output: "Python uses indentation (whitespace) to define code blocks instead of braces {}."Starts timer with length specified in minutes.
- Parameters:
timer_length(str): The desired length of the timer in minutes.
- Returns:
- No return value
Pauses current timer.
- Parameters:
- no parameters
- Returns:
- No return value
Resumes paused timer.
- Parameters:
- no parameters
- Returns:
- No return value
Ends current session.
- Parameters:
- no parameters
- Returns:
- No return value
timer = StudyTimer() # Instantiate study timer class
timer.start(25)
# Output:
# Study session started! Good luck, you got it!!
#Enter 'pause' to pause the session at any time.
timer.pause() # Pause the session
# Output:
# Study session paused, please enter 'resume' when you want to resume.
timer.resume() # Resume the session
# Output:
# Resuming now.
timer.cancel() # Cancel the session
#Output:
# Study session canceled.If you’d like to contribute:
-
Clone the repository using:
git clone https://github.com/software-students-spring2025/3-python-package-float.git cd 3-python-package-float -
Create and run virtual environment
# Install or update pipenv if needed pip install --upgrade pipenv # Create virtual environment and install dependencies pipenv install --dev # Activate virtual environment pipenv shell
-
Create a new branch and make your changes.
git checkout -b branch-name
-
Run all pytests with the following command:
pytest
-
Build the package with the following command:
python -m build
-
Commit and push changes
git add . git commit -m "description of changes" git push origin branch-name
-
Make a pull request on this project's repository on Github.