Contributing
We welcome contributions from the community! This document outlines how you can contribute to TokySnatcher.
🚀 Getting Started
Development Setup
Clone the repository
bashgit clone https://github.com/rahaaatul/TokySnatcher.git cd TokySnatcherInstall dependencies
bashpip install -e . # or with uv (recommended) uv pip install -e .Install development dependencies
bashpip install -e ".[dev]"Verify installation
bashtokysnatcher --help
🐛 Reporting Issues
Bug Reports
When reporting bugs, please include:
- TokySnatcher version:
tokysnatcher --version - Python version:
python --version - Operating system: Windows/macOS/Linux + version
- FFmpeg version:
ffmpeg -version - Steps to reproduce: Detailed steps to trigger the bug
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Error messages: Full traceback if available
- Log output: Any relevant log messages
Feature Requests
For new features, please:
- Describe the problem: What limitation are you facing?
- Describe the solution: How would you like it to work?
- Alternatives considered: Have you considered other approaches?
- Additional context: Any other relevant information
💻 Contributing Code
Development Workflow
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests:
python -m pytest(if tests exist) - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Create a Pull Request
Code Style
- Python: Follow PEP 8 style guidelines
- Imports: Organize imports (standard library, third-party, local)
- Docstrings: Use Google-style or NumPy-style docstrings
- Type hints: Add type annotations where possible
- Error handling: Use appropriate exception handling
Testing
bash
# Run tests
pytest
# Run with coverage
pytest --cov=tokysnatcher
# Run specific test
pytest tests/test_specific.py📝 Documentation
Updating Documentation
Documentation is built with VitePress in the docs branch. To update:
- Switch to docs branch:
git checkout docs - Make changes to markdown files
- Preview locally:
npm run docs:dev - Build and commit:
npm run docs:build
README Updates
Update the main README.md file in the root directory when:
- Adding new features
- Changing installation procedures
- Modifying usage instructions
- Updating requirements
🔧 Development Tools
Code Quality
bash
# Format code with black
black tokysnatcher/
# Sort imports with isort
isort tokysnatcher/
# Lint with flake8
flake8 tokysnatcher/
# Type check with mypy
mypy tokysnatcher/Pre-commit Hooks
Consider using pre-commit hooks to automate code quality checks:
bash
pip install pre-commit
pre-commit install🎯 Project Structure
TokySnatcher/
├── tokysnatcher/ # Main package
│ ├── __main__.py # CLI entry point
│ ├── chapters.py # Chapter download logic
│ ├── download.py # Download utilities
│ ├── search.py # Search functionality
│ └── utils/ # Utility functions
├── docs/ # Documentation (separate branch)
├── tests/ # Test suite
├── .github/ # GitHub workflows and templates
├── pyproject.toml # Project configuration
└── README.md # Main documentation📋 Pull Request Guidelines
Before Submitting
- [ ] Tests pass locally
- [ ] Code follows style guidelines
- [ ] Documentation updated
- [ ] Commit messages are clear and descriptive
- [ ] Changes are backwards compatible (where possible)
PR Title Format
feat:New featuresfix:Bug fixesdocs:Documentation changesrefactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
PR Description
Include:
- What changes were made
- Why they were made
- How to test the changes
- Any breaking changes
🤝 Code of Conduct
This project follows a code of conduct to ensure a welcoming environment for all contributors. By participating, you agree to:
- Be respectful and inclusive
- Focus on constructive feedback
- Accept responsibility for mistakes
- Show empathy towards other contributors
- Help create a positive community
📞 Getting Help
If you need help:
- Check existing issues: Search for similar problems
- Read the documentation: Ensure you understand current behavior
- Ask in discussions: Use GitHub Discussions for questions
- Create an issue: If you found a bug or need clarification
🙏 Recognition
Contributors will be recognized:
- In the CHANGELOG.md for significant contributions
- As co-authors on commits
- In release notes where appropriate
Thank you for contributing to TokySnatcher! 🎵