Skip to content

3.13.3 — 2025-09-30

← 3.13.4 | 3.13.2 → | ↑ 3.x series

Changed

Documentation Examples - Complete Python 3.13 & Best Practices Update

  • Comprehensive Example Documentation Refactor - Updated all 17 example files to follow modern Python 3.13 standards and ArchiPy best practices

    • Updated all type hints to Python 3.13 syntax (| for unions, lowercase built-ins, type instead of Type)
    • Replaced Union[X, Y] with X | Y throughout all examples
    • Replaced Optional[X] with X | None throughout all examples
    • Changed List, Dict to lowercase list, dict consistently
    • Removed from typing import Union, Optional in favor of native syntax
  • Exception Handling Standardization - Implemented proper exception handling patterns across all examples

    • Added try-except-else pattern with explicit return statements in else blocks
    • Ensured all exceptions use raise ... from e for proper error chaining
    • Removed operation/query messages from exception constructors (per workspace rules)
    • Replaced generic Exception, ValueError with specific ArchiPy error types
    • Added comprehensive error handling examples in all adapter documentation
  • Logging Standardization - Replaced all print statements with proper logging

    • Added logger = logging.getLogger(__name__) to all example files
    • Replaced all print() statements with appropriate logger.info(), logger.error(), etc.
    • Implemented consistent logging levels and informative messages
    • Added logging configuration examples in code snippets
  • Documentation Structure Improvements - Enhanced navigation and cross-referencing

    • Added "See Also" sections to all adapter examples
    • Linked adapter examples to corresponding BDD test .feature files
    • Added cross-references to error handling, configuration, and API documentation
    • Improved code explanations with detailed docstrings
    • Added warnings for common pitfalls and best practices
  • New Complete Examples Added

    • Email adapter with FastAPI integration and comprehensive error handling
    • SQLite adapter with async operations and context managers
    • StarRocks adapter with analytical query patterns and batch operations
    • Metaclasses with singleton pattern, thread safety, and best practices
    • Parsian payment gateway with complete payment flow and error recovery
    • Temporal workflow orchestration with atomic activities and worker management
  • Code Quality Improvements

    • All examples now syntactically correct with proper indentation
    • Fixed indentation errors in error_handling.md
    • Added security warnings for sensitive data (passwords in .env files)
    • Improved FastAPI integration examples with proper dependency injection
    • Enhanced async/await patterns with proper error handling