Thank you for your interest in contributing to the Student Utility Library! This guide will help you make your first contribution.
Look for functions marked with:
# TODO: Implement this functionStart with easy ones, then move to harder ones.
Easy:
src/string_utils/:reverse_string(),count_words(),capitalize_words()src/math_utils/:factorial(),is_prime(),mean()
Intermediate:
src/string_utils/:is_palindrome(),count_characters(),is_anagram()src/math_utils/:gcd(),lcm(),fibonacci(),median()src/file_utils/:read_file(),write_file(),count_lines()
Advanced:
src/data_structures/:Stack,Queue,LinkedList, etc.src/algorithms/: Sorting and searchingsrc/file_utils/: CSV/JSON handling
-
Read the docstring
- What the function does
- Inputs and outputs
- Examples
-
Check the tests
- Look in
tests/to understand expected output
- Look in
-
Write the code
- Replace
passwith your logic
- Replace
-
Test your function
python -m pytest tests/test_string_utils.py::TestStringUtils::test_reverse_string -v- Run all tests
python -m pytest tests/ -v- Install dependencies:
pip install -r requirements.txt- Run tests:
python -m pytest tests/ -v- Run examples:
python examples/basic_usage.py- Follow PEP 8
- Use clear variable names
- Add type hints
- Write docstrings for new functions
def reverse_string(text: str) -> str:
"""
Reverse the given string.
"""
return text[::-1]from src.string_utils import reverse_string
print(reverse_string("hello")) # olleh- Your name in README
- Your commits in Git history
- Useful for your portfolio
- Create an issue
- Fix it (optional)
- Add test cases
- Start small
- Read docstrings carefully
- Check test cases
- Use print for debugging
- Handle edge cases
- Focus on readability
- Add extra tests
- Help others
- Ignoring edge cases
- Changing function signature
- Not following docstring
- Not testing code
- Python Tutorial
- PEP 8
- Type Hints
- pytest docs
- Algorithms (Visualgo)
- Read docstring again
- Check test cases
- Look at TODO hints
- Ask in discussions
- Search online
- Pick
reverse_string() - Understand it
- Check tests
- Implement
- Run tests
- Done 🎊
Every expert started as a beginner—just start 🚀