Thank you for your interest in contributing to the Kipu API Python library! This document provides guidelines and information for contributors.
- Python 3.8 or higher
- Git
- A GitHub account
-
Fork and Clone
git clone https://github.com/Rahulkumar010/kipu-python.git cd kipu-python -
Create Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Development Dependencies
Traditional (pip):
pip install -e ".[dev]"Fast (UV - recommended): 10x faster!
pip install uv uv pip install -e ".[dev]"Or use Makefile:
make install-dev
-
Install Pre-commit Hooks
pre-commit install
try maintaining code quality standards:
- Formatting: Use
blackfor code formatting - Import Sorting: Use
isortfor import organization - Linting: Use
flake8for code linting - Type Checking: Use
mypyfor static type checking - Security: Use
banditandsafetyfor security checks
# Run all tests
make test
# Run tests with coverage
make test-cov
# Run specific test file
pytest tests/test_auth.py -v# Format code
make format
# Check formatting
make lintmake type-checkmake security-
Create Feature Branch
git checkout -b feature/amazing-feature
-
Make Changes
- Write clear, concise code
- Add tests for new functionality
- Update documentation as needed
- Follow existing code style
-
Commit Changes
git add . git commit -m "Add amazing feature"
-
Push and Create PR
git push origin feature/amazing-feature
Use conventional commit messages:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changesrefactor:Code refactoringtest:Test additions or modificationschore:Maintenance tasks
Examples:
feat: add support for new patient endpoint
fix: resolve authentication signature generation issue
docs: update README with new examples
test: add unit tests for flattener module
- Follow PEP 8 guidelines
- Use type hints for all functions and methods
- Write docstrings for all public functions
- Keep line length under 88 characters
- Use descriptive variable and function names
- All new code must have corresponding tests
- Tests should cover both success and error cases
- Aim for >90% test coverage
- Use descriptive test names
- Mock external API calls in tests
- Update README.md for new features
- Add docstrings to all public functions
- Update CHANGELOG.md
- Include code examples for new functionality
Since this library handles healthcare data:
- Never log sensitive patient data
- Use secure credential handling
- Follow HIPAA compliance guidelines
- Validate all inputs thoroughly
- Respect PHI (Protected Health Information) guidelines
- Implement proper error handling for sensitive operations
- Use secure HTTP practices
- Follow data minimization principles
When reporting bugs, please include:
-
Environment Information
- Python version
- library version
- Operating system
-
Reproduction Steps
- Clear steps to reproduce the issue
- Minimal code example
- Expected vs actual behavior
-
Error Details
- Full error messages
- Stack traces
- Relevant logs
For feature requests:
-
Check Existing Issues
- Search for similar requests
- Check project roadmap
-
Provide Context
- Use case description
- Expected functionality
- Potential implementation approach
-
Healthcare Context
- Explain healthcare-specific requirements
- Consider compliance implications
-
Adding New Endpoint
# In client.py async def get_new_endpoint(self, params: Optional[Dict[str, Any]] = None, flatten: Optional[bool] = None) -> Union[Dict[str, Any], pd.DataFrame]: """Get data from new endpoint""" response = await self.get("/api/new_endpoint", params) return await self._process_response(response, flatten)
-
Adding New Exception
# In exceptions.py class KipuNewError(KipuAPIError): """Raised when new specific error occurs""" pass
-
Adding Tests
# In tests/test_new_feature.py class TestNewFeature: def test_new_functionality(self): """Test new functionality""" # Test implementation pass
-
Update Version
- Update
__version__in__init__.py - Update version in
setup.pyandpyproject.toml
- Update
-
Update Documentation
- Update CHANGELOG.md
- Update README.md if needed
-
Create Release
- Tag release in Git
- GitHub Actions will handle PyPI deployment
- Be respectful and inclusive
- Focus on constructive feedback
- Help newcomers learn and grow
- Maintain professional communication
- Respect patient privacy in all discussions
- Consider compliance implications
- Prioritize security and data protection
- Follow healthcare industry best practices
- Documentation: Check existing docs and examples
- Issues: Search existing GitHub issues
- Discussions: Use GitHub Discussions for questions
- Email: Contact maintainers at rahul01110100@gmail.com
Contributors will be recognized in:
- CHANGELOG.md
- GitHub contributors list
- Project documentation
Thank you for contributing to the Kipu API Python library! 🎉