Contributing
We welcome contributions to wosecopy! This guide will help you get started.
Getting Started
Fork the repository on GitHub
Clone your fork locally
Create a virtual environment
Install in development mode
git clone https://github.com/yourusername/wosecopy.git
cd wosecopy
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -e ".[dev]"
Development Setup
Install Development Dependencies
pip install -e ".[dev]"
This installs:
pytest (testing)
pytest-cov (coverage)
black (code formatting)
flake8 (linting)
sphinx (documentation)
Download Language Models
python -m spacy download en_core_web_lg
python -m spacy download de_core_news_lg
Code Style
We use Black for code formatting and follow PEP 8 guidelines.
Format Code
black wosecopy/
black tests/
Lint Code
flake8 wosecopy/ tests/
Running Tests
Run All Tests
pytest
Run with Coverage
pytest --cov=wosecopy --cov-report=html
Run Specific Test File
pytest tests/test_core.py
Run Specific Test
pytest tests/test_core.py::TestwosecopyExtractor::test_initialization
Writing Tests
Test files should:
Be in the
tests/directoryStart with
test_Use pytest fixtures from
conftest.py
Example Test
import pytest
from wosecopy import wosecopyExtractor
def test_extract_nouns():
extractor = wosecopyExtractor(language='en')
nouns = extractor.extract_nouns("The dog runs.")
assert 'dog' in nouns
Documentation
Build Documentation
cd docs
make html
View locally at docs/build/html/index.html
Writing Documentation
Use reStructuredText format
Add docstrings to all public functions/classes
Follow Google or NumPy docstring style
Update relevant .rst files in
docs/source/
Submitting Changes
1. Create a Feature Branch
git checkout -b feature/my-new-feature
2. Make Your Changes
Write code
Add tests
Update documentation
Run tests and linting
3. Commit Your Changes
git add .
git commit -m "Add feature: description"
Use clear commit messages:
“Add feature: concept filtering”
“Fix bug: handle empty graphs”
“Update docs: add tutorial”
4. Push to Your Fork
git push origin feature/my-new-feature
5. Create Pull Request
Go to GitHub
Click “New Pull Request”
Describe your changes
Reference any related issues
Pull Request Guidelines
Your PR should:
Have a clear description
Include tests for new features
Update documentation as needed
Pass all CI checks
Follow code style guidelines
Code Review Process
Automated checks run (tests, linting)
Maintainers review your code
Discussion and revisions
Approval and merge
Types of Contributions
Bug Reports
Submit bug reports as GitHub issues with:
Description of the bug
Steps to reproduce
Expected vs actual behavior
System information
Feature Requests
Submit feature requests with:
Use case description
Proposed solution
Alternative solutions considered
Code Contributions
Bug fixes
New features
Performance improvements
Documentation improvements
Questions?
Open an issue for questions
Check existing issues first
Be respectful and patient
Thank You!
Thank you for contributing to wosecopy!