Thank you for your interest in contributing to Parqet Parser! This document provides guidelines and instructions for contributing.
- Be respectful and inclusive
- Provide constructive feedback
- Focus on what is best for the community
- Show empathy towards other community members
Before creating bug reports, please check existing issues. When creating a bug report, include:
- Clear title and description
- Steps to reproduce the behavior
- Expected vs actual behavior
- Sample files (anonymized) if applicable
- Environment details: OS, Python version, package versions
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- Clear title and description
- Use case - why this would be useful
- Possible implementation approach
- Alternatives considered
- Fork the repository and create a branch from
main - Make your changes following the code style guidelines
- Add tests for new functionality
- Ensure all tests pass:
pytest - Update documentation if needed
- Submit a pull request
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/parqet.parser.git
cd parqet.parser- Create virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create test configuration:
cp .env.example .env- Follow PEP 8 style guide
- Use type hints for all function signatures
- Write docstrings for all public functions and classes
- Keep functions focused and small (preferably < 50 lines)
- Use meaningful variable names
Example:
def extract_amount(text: str, currency: str = "CHF") -> Optional[str]:
"""
Extract currency amount from text.
Args:
text: Text to search in
currency: Currency code (default: CHF)
Returns:
Extracted amount or None if not found
"""
pattern = rf"{currency}\s*([\d'.,-]+)"
match = re.search(pattern, text)
return match.group(1) if match else NoneUse clear, descriptive commit messages:
feat: Add support for PostFinance broker
fix: Correct IBAN validation regex pattern
docs: Update installation instructions
test: Add tests for fee extraction
refactor: Simplify transaction deduplication logic
Prefix types:
feat:New featurefix:Bug fixdocs:Documentation changestest:Test additions/changesrefactor:Code refactoringchore:Maintenance tasks
- Place tests in
tests/directory - Name test files
test_<module>.py - Use descriptive test names:
test_extract_amount_with_swiss_format - Use pytest fixtures from
conftest.py - Mark tests appropriately:
@pytest.mark.unit,@pytest.mark.integration
Example:
@pytest.mark.unit
def test_standardize_number_swiss_format():
"""Test number standardization with Swiss thousand separator."""
assert standardize_number("1'234.56") == 1234.56# Run all tests
pytest
# Run with coverage
pytest --cov=app --cov-report=html
# Run specific test file
pytest tests/test_config_utilities.py -v
# Run tests matching pattern
pytest -k "test_extract" -v- Aim for >80% code coverage for new code
- All new features must have tests
- Bug fixes should include regression tests
To add support for a new broker:
- Create broker file:
app/lib/brokers/newbroker.py - Implement broker class inheriting from
BaseBroker - Add configuration with regex patterns
- Write tests:
tests/test_newbroker.py - Update
__init__.pyto export new broker - Update README.md with broker details
- Add sample files (anonymized) to tests
See README.md "Adding a New Broker" section for detailed example.
Use Google-style docstrings:
def process_transaction(
transaction: Dict[str, Any],
timezone: str = "Europe/Zurich"
) -> Dict[str, str]:
"""
Process a single transaction.
Args:
transaction: Raw transaction data
timezone: Target timezone for datetime conversion
Returns:
Formatted transaction dictionary
Raises:
ValidationError: If transaction data is invalid
"""Update README.md when adding:
- New features
- Configuration options
- CLI commands
- Broker support
- Update tests - ensure all tests pass
- Update documentation - README, docstrings, etc.
- Run linters:
mypy app/ pytest
- Fill out PR template with:
- Description of changes
- Related issue number
- Testing performed
- Breaking changes (if any)
- Request review from maintainers
- Address feedback in timely manner
- Open a GitHub issue for questions
- Check existing issues and documentation first
- Be patient - this is a volunteer project
Thank you for contributing! 🎉