Spaces:
Running
A newer version of the Streamlit SDK is available: 1.55.0
π€ Contributing to NoteSnap
Thank you for your interest in contributing to NoteSnap! This document provides guidelines and information for contributors.
π Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Submitting Changes
- Style Guidelines
- Testing
- Documentation
π Code of Conduct
This project and everyone participating in it is governed by our commitment to creating a welcoming and inclusive environment. Please be respectful and constructive in all interactions.
π Getting Started
Prerequisites
- Python 3.8 or higher
- Git
- Docker (optional but recommended)
- Basic knowledge of Python, Streamlit, and AI/ML concepts
Fork and Clone
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/NoteSnap.git cd NoteSnap
π οΈ Development Setup
Local Development
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtRun the application:
streamlit run app.py
Docker Development
Build and run with Docker:
./docker-dev.shOr use Docker Compose:
docker-compose -f docker-compose.dev.yml up
π Making Changes
Branch Naming
Use descriptive branch names:
feature/add-new-model-supportbugfix/fix-pdf-processing-errordocs/update-installation-guiderefactor/improve-error-handling
Commit Messages
Follow conventional commit format:
type(scope): description
[optional body]
[optional footer]
Examples:
feat(summarizer): add support for T5 modelfix(pdf): resolve text extraction encoding issuedocs(readme): update installation instructions
π€ Submitting Changes
Pull Request Process
Create a feature branch:
git checkout -b feature/your-feature-nameMake your changes and commit:
git add . git commit -m "feat: add your feature description"Push to your fork:
git push origin feature/your-feature-nameCreate a Pull Request on GitHub with:
- Clear title and description
- Reference to related issues
- Screenshots if applicable
- Test results
Pull Request Requirements
- Code follows project style guidelines
- All tests pass
- Documentation updated if needed
- No breaking changes (or clearly documented)
- Self-review completed
π¨ Style Guidelines
Python Code Style
- Follow PEP 8
- Use meaningful variable and function names
- Add docstrings for functions and classes
- Keep functions focused and small
- Use type hints where appropriate
Example:
def process_pdf_file(uploaded_file: UploadedFile) -> Optional[str]:
"""
Extract text content from uploaded PDF file.
Args:
uploaded_file: Streamlit uploaded file object
Returns:
str: Extracted text content or None if extraction fails
"""
# Implementation here
pass
File Organization
- Keep modules focused on single responsibilities
- Use clear directory structure
- Add
__init__.pyfiles for packages - Group related functionality together
π§ͺ Testing
Running Tests
# Basic functionality tests
python test_basic.py
# Docker tests
./docker-test.sh
# Manual testing checklist
# - PDF upload and processing
# - Text input and summarization
# - Different AI models
# - Error handling scenarios
Writing Tests
- Add tests for new features
- Test edge cases and error conditions
- Use descriptive test names
- Keep tests independent and isolated
π Documentation
Code Documentation
- Add docstrings to all functions and classes
- Include type hints
- Comment complex logic
- Update README.md for new features
User Documentation
- Update usage instructions
- Add examples for new features
- Include troubleshooting information
- Keep Docker documentation current
π Reporting Issues
When reporting bugs:
- Use the bug report template
- Include environment details
- Provide steps to reproduce
- Add relevant logs and screenshots
- Check for existing similar issues
π‘ Suggesting Features
When suggesting features:
- Use the feature request template
- Explain the use case and motivation
- Consider implementation complexity
- Provide mockups or examples if helpful
π·οΈ Issue Labels
bug- Something isn't workingenhancement- New feature or requestdocumentation- Improvements or additions to docsgood first issue- Good for newcomershelp wanted- Extra attention is neededquestion- Further information is requested
π― Areas for Contribution
High Priority
- Bug fixes and stability improvements
- Performance optimizations
- Better error handling
- Documentation improvements
Medium Priority
- New AI model integrations
- UI/UX enhancements
- Additional file format support
- Internationalization
Low Priority
- Code refactoring
- Additional testing
- Development tooling
- CI/CD improvements
π Getting Help
- π¬ GitHub Discussions
- π Issues
π Recognition
Contributors will be:
- Listed in the README.md
- Mentioned in release notes
- Given credit in commit messages
- Invited to be maintainers (for significant contributions)
Thank you for contributing to NoteSnap! π