First off, thank you for considering contributing to TrueEntropy! 🎉
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check the existing issues as you might find that the bug has already been reported.
When creating a bug report, please include:
- A clear and descriptive title
- Steps to reproduce the behavior
- Expected behavior
- Actual behavior
- Python version (
python --version) - TrueEntropy version (
pip show trueentropy) - Operating system
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
- A clear and descriptive title
- A detailed description of the proposed feature
- Why this feature would be useful
- Possible implementation approach (optional)
- Fork the repository and create your branch from
main - Install development dependencies:
pip install -e ".[dev]" - Make your changes
- Run the tests:
pytest
- Run the linters:
ruff check src/ black --check src/
- Commit your changes using conventional commits:
feat: add new feature fix: resolve bug docs: update documentation test: add tests refactor: code improvements - Push to your fork and submit a pull request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/TrueEntropy-PyLib.git
cd TrueEntropy-PyLib
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Run linters
ruff check src/
black src/TrueEntropy/
├── src/trueentropy/
│ ├── __init__.py # Public API
│ ├── pool.py # Entropy pool
│ ├── tap.py # Value extraction
│ ├── collector.py # Background collection
│ ├── health.py # Health monitoring
│ └── harvesters/ # Entropy sources
│ ├── timing.py
│ ├── network.py
│ ├── system.py
│ ├── external.py
│ ├── weather.py
│ └── radioactive.py
├── tests/ # Test suite
├── README.md
├── ARCHITECTURE.md # Technical documentation
├── CHANGELOG.md # Version history
└── pyproject.toml # Project configuration
- Write tests for all new features
- Maintain test coverage for existing functionality
- Use descriptive test names that explain the behavior being tested
- Group related tests in classes
class TestFeatureName:
def test_feature_does_something(self) -> None:
"""Feature should do something specific."""
result = feature()
assert result == expected- Follow PEP 8
- Use Black for formatting
- Use Ruff for linting
- Add type hints to all functions
- Write docstrings for public APIs
- Create a new file in
src/trueentropy/harvesters/ - Inherit from
BaseHarvester - Implement
nameproperty andcollect()method - Add tests in
tests/test_harvesters.py - Register in
lazy.pyfor lazy loading
from trueentropy.harvesters.base import BaseHarvester, HarvestResult
class MyHarvester(BaseHarvester):
@property
def name(self) -> str:
return "my_harvester"
def collect(self) -> HarvestResult:
# Collect entropy from your source
data = self._collect_data()
return HarvestResult(
data=data,
entropy_bits=len(data) * 2, # Conservative estimate
source=self.name,
success=True
)Feel free to open an issue with the "question" label or reach out to the maintainers.
Obrigado de coração por contribuir! Tmj! 🙏