Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

🧪 Lab 03 - Typed Configuration Loader

🎯 Objective

Created a typed configuration loader using Pydantic models, field validators, defaults, JSON/YAML support, reload functionality, and explicit validation errors.

📚 Prerequisites

  • Basic Python programming knowledge (functions, classes, dictionaries)
  • Understanding of data types and type hints
  • Familiarity with JSON/YAML file formats
  • Basic Linux command line skills
  • Text editor experience (vim, nano, or VS Code)

🖥️ Lab Environment

  • Operating System: Ubuntu 24.04 LTS cloud lab environment
  • Primary User: toor
  • Python Runtime: Python 3.12.x in a virtual environment

✅ Learning Objectives Covered

  • Implement type-safe configuration loading mechanisms
  • Validate configuration data against expected schemas
  • Apply default values for missing configuration entries
  • Detect and handle invalid or missing configuration values
  • Build robust configuration management for production systems

🧩 Task Overview

This lab was completed through the following high-level activities:

  • Step 1: Create Project Structure
  • Step 2: Define Configuration Schema
  • Step 3: Create Sample Configuration Files
  • Step 1: Create Test Suite
  • Step 2: Implement Configuration Loader
  • Step 3: Test Your Implementation
  • Step 4: Create a Practical Usage Example

📁 Repository Structure

lab03-typed-configuration-loader/
├── README.md
├── commands.sh
├── output.txt
├── interview_qna.md
├── troubleshooting.md
└── project/
    app_example.py
    config_loader.py
    configs/invalid_config.yaml
    configs/minimal_config.json
    configs/valid_config.yaml
    test_configs.py

🔍 Verification & Validation

    1. Test valid configuration loading
    1. Test default values
    1. Test validation errors
    1. Run full test suite

🧠 What I Learned

  • How schema validation improves configuration safety before runtime.
  • How to support both YAML and JSON while keeping one typed contract.
  • How defaults reduce configuration sprawl for optional settings.
  • How clear validation messages speed up debugging and deployment fixes.

🌍 Why This Matters

Typed configuration management reduces runtime surprises and creates a reliable contract between infrastructure, deployment code, and application logic. That becomes especially important when moving software between environments.

🚀 Real-World Applications

  • Application bootstrap and deployment configuration loading.
  • Environment-specific settings validation for staging and production.
  • Reusable config schemas in internal platform tooling.

📌 Result

Validated YAML and JSON configuration flows with defaults, schema enforcement, and reload support.

🏁 Conclusion

This lab strengthened my hands-on foundation in typed configuration loader and produced a clean set of project files, command history, execution output, interview notes, and troubleshooting guidance for portfolio use.

All code, commands, outputs, and support material used for this lab are organized in this folder for traceability and GitHub documentation readiness.