A template repository for creating Python packages.
- Common repository files:
.gitignore
with common files to be excluded by git for Python.pre-commit-config.yaml
with automated pre-commit validation for PythonLICENSE
outlining usage rightsMakefile
standardising commandsCODE_OF_CONDUCT.md
outlining community practiceOWNERS.md
outlining owners and rolesREADME.md
overview documentation
- Tool configuration:
- editorconfig - universal editor configuration
- ruff - linting, formatting and vulnerabilities
- perflint - linting performance anti-patterns
- mypy - type checking
- pyupgrade - latest syntax upgrades
- radon - code quality
- removestar - automated removal of wildcard imports (*)
- pytest - testing
- coverage - test coverage
- sphinx - documentation
- github-pages - documentation deployment and hosting
- build - packaging
- twine - deployment
- Examples:
- Repository tree structure
- Python module
- Unit tests
pysamplelib
is available via Test PyPI (via Platform Wheels):
pip install --index-url https://test.pypi.org/simple/ pysamplelib
Running fizzbuzz against a number:
import pysamplelib
print(pysamplelib.fizzbuzz(5))
Running fizzbuzz against a number range:
import pysamplelib
for number in range(1, 101):
print(pysamplelib.fizzbuzz(number))
Running fizzbuzz against a number, using a custom keyword mapping:
import pysamplelib
CUSTOM_KEYWORD_MAPPING = {
7: "Riff",
9: "Blip",
}
print(pysamplelib.fizzbuzz(7, CUSTOM_KEYWORD_MAPPING))
pysamplelib
is licensed under the MIT License