Skip to content

Contributing

Contributions to The Data Packet are welcome. This page covers the contribution process; Development Setup covers the local dev environment.


Ways to contribute

  • Bug reports


    Open an issue with steps to reproduce, expected behaviour, and actual behaviour.

  • Feature requests


    Open an issue describing the use case and proposed solution. Discuss approach before writing code for significant changes.

  • Pull requests


    Bug fixes, new article sources, documentation improvements. All PRs require passing CI (format, type check, tests).

  • Documentation


    Corrections, clearer explanations, additional examples. Docs live in docs/ and are written in Markdown.


Contribution process

  1. Open an issue first for significant changes — agree on approach before writing code.
  2. Fork the repository and create a feature branch from main.
  3. Write tests for any new functionality.
  4. Run the full quality check before submitting:

    hatch run format
    hatch run format-check
    hatch run typecheck
    hatch run test
    
  5. Open a pull request against main with a clear description.


Adding a new article source

The source system is designed for extension. To add a new source:

1. Create the module

the_data_packet/sources/your_source.py
from the_data_packet.sources.base import Article, ArticleSource

class YourSource(ArticleSource):
    def collect_articles(
        self,
        categories: list[str],
        max_articles: int,
    ) -> list[Article]:
        # Fetch and return Article objects
        ...

2. Register it

Add to the_data_packet/sources/__init__.py and the --sources choices in cli.py.

3. Add tests

tests/sources/test_your_source.py

Code standards

Standard Tool Config
Formatting black line length 88, target py3.9
Import order isort black-compatible profile
Linting flake8 max line length 120
Type hints mypy strict, ignore missing imports
Docstrings Google style all public classes and functions

Reporting security issues

Open a security vulnerability report on GitHub. For high-severity issues where public disclosure would be harmful before a fix is available, use GitHub's private security advisory instead.

Either way, include:

  • Description of the vulnerability
  • Steps to reproduce
  • Potential impact

License

By contributing, you agree that your contributions will be licensed under the MIT License.