Thank you for your interest in contributing to RFM Insight Engine! 🚀
This document provides guidelines and information for contributors.
Before creating an issue, please:
- Search existing issues to avoid duplicates
- Check the documentation to see if your question is already answered
- Use the issue template when creating new issues
- 🐛 Bug Report: Something isn't working as expected
- 💡 Feature Request: Suggest a new feature or enhancement
- 📚 Documentation: Improve or add documentation
- ❓ Question: Ask a question about usage
# Fork and clone the repository
git clone https://github.com/yourusername/rfm-insight-engine.git
cd rfm-insight-engine
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install development dependencies
pip install -r requirements-dev.txt # Coming soon-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Follow the coding standards (see below)
- Add tests for new functionality
- Update documentation as needed
-
Test your changes
# Run tests python -m pytest tests/ # Run linting flake8 src/ # Run the demo to ensure everything works python run_analysis.py
-
Commit your changes
git add . git commit -m "Add feature: brief description of your changes"
-
Push and create a Pull Request
git push origin feature/your-feature-name
- Code follows style guidelines (PEP 8)
- Tests pass and new tests are added
- Documentation is updated if needed
- README is updated if adding new features
- No merge conflicts with main branch
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tests pass
- [ ] Manual testing completed
- [ ] Demo script runs successfully
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No console errorsWe follow PEP 8 with some modifications:
# Good example
class RFMCalculator:
"""RFM calculation and scoring module."""
def __init__(self):
self.rfm_data = None
self.segments = None
def calculate_rfm_scores(self, rfm_data: pd.DataFrame) -> pd.DataFrame:
"""
Calculate RFM scores based on quantiles.
Args:
rfm_data: DataFrame with Recency, Frequency, Monetary columns
Returns:
DataFrame with RFM scores
"""
# Implementation here
passsrc/
├── __init__.py
├── engine.py # Main engine
├── core/ # Core functionality
│ ├── __init__.py
│ ├── data_processor.py
│ └── rfm_calculator.py
├── visualization/ # Plotting and charts
│ ├── __init__.py
│ └── plotter.py
└── strategy/ # Marketing strategies
├── __init__.py
└── marketing_strategies.py
- Docstrings: Use Google style docstrings
- Comments: Explain complex logic, not obvious code
- README: Update when adding new features
- Type Hints: Use type hints for function parameters and returns
import pytest
import pandas as pd
from src.core.rfm_calculator import RFMCalculator
def test_rfm_calculation():
"""Test RFM score calculation."""
# Create sample data
data = pd.DataFrame({
'Recency': [10, 20, 30],
'Frequency': [5, 10, 15],
'Monetary': [100, 200, 300]
})
# Test calculation
calculator = RFMCalculator()
result = calculator.calculate_rfm_scores(data)
# Assertions
assert 'R_Score' in result.columns
assert 'F_Score' in result.columns
assert 'M_Score' in result.columns# Run all tests
python -m pytest
# Run with coverage
python -m pytest --cov=src
# Run specific test file
python -m pytest tests/test_rfm_calculator.py-
Code Documentation
- Docstrings for functions and classes
- Inline comments for complex logic
- Type hints
-
User Documentation
- README updates
- Tutorial notebooks
- API documentation
-
Developer Documentation
- Architecture decisions
- Contributing guidelines
- Development setup
- Use clear, concise language
- Include examples where helpful
- Use markdown formatting consistently
- Add screenshots for UI changes
We use Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
- All tests pass
- Documentation updated
- Version bumped
- CHANGELOG updated
- Release notes prepared
- 🐛 Bug fixes in existing functionality
- 📚 Documentation improvements
- 🧪 Test coverage improvements
- 🚀 Performance optimizations
- 🎨 UI/UX improvements for notebooks
- 🌐 Multi-language support
- 📊 Additional visualization types
- 🔧 Configuration options
- 🐳 Docker support
- ☁️ Cloud deployment guides
- 📱 Mobile-friendly documentation
- 🎯 Integration examples
We are committed to providing a welcoming and inclusive environment:
- Be respectful and constructive
- Be patient with newcomers
- Be open to feedback and suggestions
- Be collaborative and helpful
- 💬 GitHub Issues: Bug reports and feature requests
- 💬 GitHub Discussions: General questions and ideas
- 📧 Email: massoud@example.com for sensitive issues
Contributors will be recognized in:
- 📄 README.md contributors section
- 📋 CHANGELOG.md for significant contributions
- 🏆 GitHub contributor stats
- 📢 Release notes for major features
If you have questions about contributing:
- Check existing issues and discussions
- Read the documentation
- Create a new issue with the "question" label
- Email us at massoud@example.com
Thank you for contributing to RFM Insight Engine! 🙏
Your contributions help make customer analytics accessible to everyone.