Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Example Template

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.

Prerequisites

  1. Ensure you have installed the core package dependencies from the root repository.
    hatch env create
  2. Install any example-specific requirements (none required for this basic template):
    pip install -r requirements.txt

Running the Example

Execute the main script from the root of the repository to ensure all relative paths and imports resolve correctly:

python examples/example_template/main.py

Core Components Highlighted

This 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 Settings model using project_name.settings.Settings.
  • Telemetry (Logging): How to properly configure application logging using project_name.logging.LoggingSettings and configure_logger to emit structured logs.
  • Best Practices: Demonstration of clear code organization, descriptive docstrings, and safe execution patterns (if __name__ == "__main__":).