Python
With only a few exceptions, Smarter Framework is implemented in Python. There are certain conventions and best practices that we’ve adopted, and want to impress upon future contributors to the project.
Coding Style
Smarter Framework follows the PEP 8 – Style Guide for Python Code.
Smarter Framework uses Black as its code formatter.
isort to sort imports.
flake8 for linting.
flake8-coding for coding style linting.
pylint for code linting.
pylint-django for Django-specific linting.
mypy for static type checking.
pyupgrade to automatically upgrade syntax for newer Python versions.
codespell to check for spelling errors.
bandit for security linting.
coverage to measure test coverage.
pydocstringformatter to format docstrings.
pre-commit for managing git hooks.
tox for testing in multiple environments.
watchdog for file system monitoring.
pre-commit hooks for additional checks, such as fixing byte order markers, checking for merge conflicts, trailing whitespace, and more.
Type Hinting
Smarter Framework uses Python type hinting extensively throughout the codebase. This helps improve code readability, provides better support for IDEs, and enables static type checking with tools like mypy.
pandas-stubs for pandas type annotations.
types-cachetools for cachetools type annotations.
types-lxml for lxml type annotations.
types-Markdown for Markdown type annotations.
types-paramiko for paramiko type annotations.
types-PyYAML for PyYAML type annotations.
types-requests for requests type annotations.
django-stubs for Django type annotations.
djangorestframework-stubs for Django REST Framework type annotations.
mypy_extensions for additional type annotation utilities.
Documentation
See the Documentation Style Guide.
Dependencies
Smarter Framework relies on a number of third-party Python packages to provide various functionalities. These are maintained in the smarter/requirements/in directory of the project, with separate files for different environments and use cases.
Smarter Framework Python Requirements