This directory serves as a generic template for creating new examples in the project_name repository. It demonstrates the standard structure, documentation, and foundational code required for a well-formed example, ensuring it adheres to the latest standards and workflows.
- Ensure you have installed the core package dependencies from the root repository.
hatch env create
- Install any example-specific requirements (none required for this basic template):
pip install -r requirements.txt
Execute the main script from the root of the repository to ensure all relative paths and imports resolve correctly:
python examples/example_template/main.pyThis template highlights the following essential components that should be included in most project examples:
- Standard Structure: A contained directory with its own
README.md,requirements.txt, and executable python script (main.py). - Configuration (Settings): How to initialize the
Settingsmodel usingproject_name.settings.Settings. - Telemetry (Logging): How to properly configure application logging using
project_name.logging.LoggingSettingsandconfigure_loggerto emit structured logs. - Best Practices: Demonstration of clear code organization, descriptive docstrings, and safe execution patterns (
if __name__ == "__main__":).