Contributing
Thank you for your interest in contributing to the Kipu API Python library! This document provides guidelines and information for contributors.
Getting Started
Prerequisites
Python 3.8 or higher
Git
A GitHub account
Setting Up Development Environment
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
pip install -e ".[dev]"
Install Pre-commit Hooks
pre-commit install
Development Workflow
Code Quality
Try maintaining code quality standards:
Formatting: Use
blackfor code formattingImport Sorting: Use
isortfor import organizationLinting: Use
flake8for code lintingType Checking: Use
mypyfor static type checkingSecurity: Use
banditandsafetyfor security checks
Running Tests
# Run all tests
make test
# Run tests with coverage
make test-cov
# Run specific test file
pytest tests/test_auth.py -v
Code Formatting
# Format code
make format
# Check formatting
make lint
Type Checking
make type-check
Security Checks
make security
Contribution Guidelines
Pull Request Process
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
Commit Message Guidelines
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
Code Style
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
Testing Requirements
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
Documentation
Update
README.mdfor new featuresAdd docstrings to all public functions
Update
CHANGELOG.mdInclude code examples for new functionality
Healthcare Code Guidelines
Security Considerations
Never log sensitive patient data
Use secure credential handling
Follow HIPAA compliance guidelines
Validate all inputs thoroughly
Data Handling
Respect PHI (Protected Health Information) guidelines
Implement proper error handling for sensitive operations
Use secure HTTP practices
Follow data minimization principles
Bug Reports
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
Feature Requests
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
Development Tasks
Common Tasks
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
Release Process
Update
__version__in__init__.pyUpdate version in
setup.pyandpyproject.tomlUpdate documentation (CHANGELOG.md, README.md if needed)
Tag release in Git
GitHub Actions will handle PyPI deployment
Code of Conduct
Our Standards
Be respectful and inclusive
Focus on constructive feedback
Help newcomers learn and grow
Maintain professional communication
Healthcare Context
Respect patient privacy in all discussions
Consider compliance implications
Prioritize security and data protection
Follow healthcare industry best practices
Getting Help
Documentation: Check existing docs and examples
Issues: Search existing GitHub issues
Discussions: Use GitHub Discussions for questions
Email: Contact maintainers at rahul01110100@gmail.com
Recognition
Contributors will be recognized in:
CHANGELOG.md
GitHub contributors list
Project documentation
Thank you for contributing to the Kipu API Python library!