wshobson avatar

Python Configuration

Solid foundation for externalizing Python app configuration using pydantic-settings and environment variables. Sets up typed configuration classes that validate at startup and fail fast with clear error messages when required values are missing. Covers the essentials: structured settings with sensible local defaults, secret management, environment-specific behavior, and type coercion for booleans and lists. The nested configuration pattern using double underscores is clean for organizing complex apps. Most importantly, it enforces the twelve-factor principle of keeping config separate from code so you can deploy the same codebase across environments without modification.

skills.sh installs
12K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill python-configuration --agent claude-code

Installs into .claude/skills of the current project.

Files

Python Configuration Management

Externalize configuration from code using environment variables and typed settings. Well-managed configuration enables the same code to run in any environment without modification.

When to Use This Skill

  • Setting up a new project's configuration system
  • Migrating from hardcoded values to environment variables
  • Implementing pydantic-settings for typed configuration
  • Managing secrets and sensitive values
  • Creating environment-specific settings (dev/staging/prod)
  • Validating configuration at application startup

Core Concepts

1. Externalized Configuration

All environment-specific values (URLs, secrets, feature flags) come from environment variables, not code.

2. Typed Settings

Parse and validate configuration into typed objects at startup, not scattered throughout code.

3. Fail Fast

Validate all required configuration at application boot. Missing config should crash immediately with a clear message.

4. Sensible Defaults

Provide reasonable defaults for local development while requiring explicit values for sensitive settings.

Quick Start

Sponsors

Details

Repository
github.com/wshobson/agents
Category
Python

More from wshobson/agents

All 174

Recommended

More Python
1wshobson avatartemporal-python-testingwshobson/agentsTest Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setu11.3Kskills.sh installs
2affaan-m avatarpython-testingaffaan-m/eccPython testing strategies using pytest, TDD methodology, fixtures, mocking, parametrization, and coverage requirements.6Kskills.sh installs
3affaan-m avatardjango-tddaffaan-m/eccDjango testing strategies with pytest-django, TDD methodology, factory_boy, mocking, coverage, and testing Django REST Framework APIs.5.8Kskills.sh installs
4jeffallan avatardjango-expertjeffallan/claude-skillsUse when building Django web applications or REST APIs with Django REST Framework. Invoke when working with settings.py, models.py, manage.py, or any Django pro4.5Kskills.sh installs
5pydantic avatarpydantic-ai-harnesspydantic/skillsExtend Pydantic AI agents with batteries-included capabilities from pydantic-ai-harness -- Code Mode (collapse many tool calls into one sandboxed Python executi3Kskills.sh installs
6getsentry avatardjango-access-reviewgetsentry/skillsDjango access control and IDOR security review. Use when reviewing Django views, DRF viewsets, ORM queries, or any Python/Django code handling user authorizatio2.8Kskills.sh installs