Contributions are welcome! Here's how to get started.
git clone https://github.com/azizjon-aliev/python-dsa.git
cd python-dsa
uv sync --group dev
uv run pre-commit install- Create a branch from
main - Implement your changes
- Run checks before committing:
uv run pytest tests/ -v # tests + coverage
uv run ruff check . # linter
uv run ruff format . # formatter
uv run ty check # type checker- Open a pull request
- Create an ABC interface in
<module>/base.py - Implement the concrete class in its own file
- Add
__repr__,__str__,__eq__,__bool__,__len__,__contains__ - Add tests in
tests/test_<module>.py - Add property-based tests in
tests/test_properties.py - Update
README.mdwith usage examples and complexity table
- Create the module under
algorithms/<category>/ - Add tests in
tests/test_<algorithm>.py - Update
README.md
- Follow existing patterns in the codebase
- Use type hints everywhere
- Add docstrings with complexity notes (e.g.
O(n)) - Keep line length under 88 characters (enforced by ruff)
- All pre-commit hooks must pass before merging