Genro-Toolbox Logo

Contents

  • Genro-Toolbox
  • Installation
    • Requirements
    • Install from PyPI
    • Install from Source
    • Verify Installation
    • Optional Dependencies
      • Development
      • Documentation
    • Next Steps
  • Quick Start
    • Installation
    • Basic Usage
      • Example: Service Configuration
    • Three Calling Styles
      • Style 1: Prefix Style (Most Explicit)
      • Style 2: Dict Style (Compact)
      • Style 3: Boolean Activation (Use Defaults)
    • Multiple Prefix Families
    • Why Use extract_kwargs?
      • Problem: Nested Configuration is Messy
    • Next Steps
  • extract_kwargs Decorator
    • Overview
    • Basic Usage
    • Multiple Prefix Families
    • Calling Styles
      • Style 1: Prefix Style (Most Explicit)
      • Style 2: Dict Style (Compact)
      • Style 3: Boolean Activation
    • Advanced Options
      • Custom Extraction Options
      • Keep Prefix in Keys
    • Reserved Keywords
    • Merging with Existing kwargs
    • Advanced Features
      • Dynamic Extraction Specs (_dictkwargs)
      • Adapter Hook (_adapter)
    • Signature
    • Requirements
    • Works with Functions Too
    • See Also
  • SmartOptions Guide
    • Overview
    • Basic Usage
    • Loading from Files
    • Loading from Environment Variables
    • Loading from Function Signatures
      • Using env and argv Parameters
      • Legacy argv Syntax
      • Annotated Types
    • Composing with + Operator
    • Nested Structures
      • Nested Dicts Become SmartOptions
      • String Lists Become Feature Flags
      • List of Dicts Indexed by First Key
    • Filtering Options
      • Ignore None Values
      • Ignore Empty Collections
      • Custom Filter Function
    • Access Patterns
    • Real-World Example
    • API Reference
    • See Also
  • TreeDict
    • Basic Usage
    • Creating TreeDict
      • From dict
      • From JSON string
      • From config file
      • Empty TreeDict
    • Writing Values
    • List Access
    • Deleting Keys
    • Walking All Paths
      • Expanding Lists
    • Thread-Safe Access
      • Synchronous (threading)
      • Asynchronous (asyncio)
    • Converting Back to Dict
    • SmartOptions Relationship
    • Use Cases
      • Configuration Access
      • Building Nested Structures
      • Safe Navigation
  • tags_match Guide
    • Overview
    • Basic Usage
    • Operators
      • OR Operator
      • AND Operator
      • NOT Operator
    • Operator Precedence
    • Grouping with Parentheses
    • Keyword Operators
    • Complex Expressions
    • Safety Limits
    • Error Handling
    • Valid Tag Names
    • Whitespace Handling
    • Real-World Examples
      • Access Control
      • Feature Flags
      • Content Filtering
    • API Reference
      • Grammar
    • See Also
  • safe_is_instance Guide
    • Overview
    • Basic Usage
    • Custom Classes
    • Subclass Recognition
    • Multiple Inheritance
    • Use Cases
      • Avoiding Circular Imports
      • Plugin System
      • Optional Dependencies
    • Edge Cases
      • Non-existent Classes
      • Partial Class Names
      • Nested Classes
    • Performance
    • API Reference
    • See Also
  • ASCII Table
    • Overview
    • Quick Start
      • Basic Table
      • With Title
    • Data Structure Format
      • Headers
      • Rows
      • Table Options
    • Type Formatting
      • String
      • Integer
      • Float
      • Boolean
      • Date
      • DateTime
    • Column Alignment
    • Hierarchical Data
    • Text Wrapping
    • ANSI Color Support
    • Markdown Export
    • Complete Example
    • API Reference
      • Main Functions
        • render_ascii_table(data, max_width=None)
        • render_markdown_table(data)
      • Utility Functions
        • format_cell(value, coldef)
        • strip_ansi(text)
        • normalize_date_format(fmt)
        • parse_bool(value)
    • See Also
  • SmartAsync - Unified Sync/Async API
    • Overview
    • Installation
    • When to Use
      • Use @smartasync when:
      • Don’t use @smartasync when:
    • Core Components
      • @smartasync Decorator
        • Sync Context Usage
        • Async Context Usage
      • Execution Matrix
      • Inline Usage
    • Architecture
      • Per-Thread Event Loop Pool
      • Context Detection
    • Helper Functions
      • smartawait
      • smartcontinuation
      • SmartLock
    • Caveats and Best Practices
      • Nested Mixed Calls
      • Best Practice: Leaf-Level Decoration
      • Testing
    • FAQ
      • Q: Why not just use asyncio.run()?
      • Q: Does @smartasync have overhead?
      • Q: Can I use @smartasync on class methods?
      • Q: What happens if I forget @smartasync on a nested async call?
      • Q: Is it thread-safe?
      • Q: What about async for and async with?
      • Q: Can I call a @smartasync method from within another @smartasync method?
      • Q: Why use SmartLock instead of regular caching?
    • API Reference
      • smartasync(method)
      • smartawait(value)
      • smartcontinuation(value, on_resolved, *args, **kwargs)
      • SmartLock
      • reset_smartasync_cache()
  • SmartTimer - Non-Blocking Timers
    • Overview
    • Installation
    • API
      • set_timeout
      • set_interval
      • cancel_timer
    • Context Detection
    • Real-World Examples
      • Token refresh (inside a server/worker)
      • Heartbeat / keepalive (ASGI server)
      • Job polling (async worker)
      • Cache invalidation (sync WSGI server)
    • Timer IDs
    • Thread Safety
    • Note on Standalone Scripts
  • Best Practices
    • General Guidelines
      • 1. Always Use Type Hints
      • 2. Document Expected Parameters
      • 3. Provide Sensible Defaults
    • Common Patterns
      • Pattern 1: Plugin Configuration
      • Pattern 2: Nested Object Creation
      • Pattern 3: Configuration from Files
    • Performance Considerations
      • Minimize Decorator Overhead
      • Use pop=False Only When Needed
    • Error Handling
      • Validate Extracted Configuration
      • Handle Optional Configurations Gracefully
    • Testing
      • Test with Different Calling Styles
      • Mock for Testing
    • Security Considerations
      • Sanitize Parameters
      • Avoid Injection Risks
    • Integration with Other Tools
      • With Pydantic
      • With dataclasses
    • See Also
  • Examples
    • Genro Integration
    • Web Framework Configuration
    • CLI Tool Configuration
    • Data Pipeline
    • See Also
  • API Reference
    • extract_kwargs
      • extract_kwargs()
      • Function Signature
      • Parameters
      • Returns
      • Examples
    • SmartOptions
      • SmartOptions
        • SmartOptions.__init__()
        • SmartOptions.__add__()
        • SmartOptions.__repr__()
      • Class Signature
      • Parameters
      • Methods
      • Examples
    • TreeDict
      • TreeDict
        • TreeDict.__init__()
        • TreeDict.__enter__()
        • TreeDict.__exit__()
        • TreeDict.__aenter__()
        • TreeDict.__aexit__()
        • TreeDict.__getitem__()
        • TreeDict.__setitem__()
        • TreeDict.__delitem__()
        • TreeDict.__contains__()
        • TreeDict.__len__()
        • TreeDict.__iter__()
        • TreeDict.__repr__()
        • TreeDict.__eq__()
        • TreeDict.keys()
        • TreeDict.values()
        • TreeDict.items()
        • TreeDict.get()
        • TreeDict.as_dict()
        • TreeDict.from_file()
        • TreeDict.walk()
      • Class Signature
      • Parameters
      • Key Features
      • Methods
      • Examples
    • safe_is_instance
      • safe_is_instance()
      • Function Signature
      • Parameters
      • Returns
      • Examples
    • ASCII Table
      • render_ascii_table
        • render_ascii_table()
      • Function Signature
      • Parameters
      • Returns
      • render_markdown_table
        • render_markdown_table()
      • Function Signature
      • Parameters
      • Returns
      • Examples
    • tags_match
      • tags_match()
      • Function Signature
      • Parameters
      • Returns
      • Raises
      • Operators
      • Grammar
      • Examples
    • RuleError
      • RuleError
    • get_uuid
      • get_uuid()
      • Function Signature
      • Returns
      • Format
      • Properties
      • Examples
    • smartasync
      • smartasync()
      • Function Signature
      • Parameters
      • Returns
      • How It Works
      • Features
      • Examples
      • Cache Reset
    • Helper Functions
      • filtered_dict
    • DictObj
      • DictObj
      • Class Signature
      • Examples
    • smartsplit
      • smartsplit()
      • Function Signature
      • Parameters
      • Returns
      • Examples
    • smarttimer
      • set_timeout()
      • set_interval()
      • cancel_timer()
      • set_timeout
      • set_interval
      • cancel_timer
      • Context Detection
      • Examples
    • dictExtract
    • Type Definitions
    • See Also
  • FAQ
    • General
      • What is genro-toolbox?
      • Why use genro-toolbox instead of writing my own utilities?
      • What Python versions are supported?
    • SmartOptions
      • Why use SmartOptions instead of a plain dict?
      • What counts as “empty” when using ignore_empty=True?
      • Can I modify SmartOptions after creation?
    • extract_kwargs
      • Why does extract_kwargs always return a dict, never None?
      • What happens to the reserved word “class”?
      • Can I use extract_kwargs on functions (not just methods)?
      • What’s the difference between pop=True and pop=False?
    • safe_is_instance
      • Why not just use isinstance()?
      • Does safe_is_instance work with subclasses?
      • Is safe_is_instance cached?
    • Tables
      • What’s the difference between render_ascii_table and render_markdown_table?
      • How do I format dates?
      • How does boolean formatting work?
    • Troubleshooting
      • I get “ModuleNotFoundError: No module named ‘genro_toolbox’”
      • Type hints aren’t working in my IDE
  • Architecture
    • Overview
    • Core Components
      • 1. extract_kwargs Decorator
      • 2. dictExtract Utility
    • Design Principles
      • 1. Zero Dependencies
      • 2. Performance Optimization
      • 3. Type Safety
    • Execution Flow
      • Basic Flow
      • With Adapter
    • Type System
    • Error Handling
      • Missing Adapter
      • Reserved Names
    • Testing Architecture
    • Extension Points
      • Custom Adapters
      • Dynamic Specifications
    • See Also
  • Contributing
    • Development Setup
      • 1. Clone the Repository
      • 2. Create Virtual Environment
      • 3. Install Development Dependencies
      • 4. Run Tests
    • Project Structure
    • Coding Standards
      • Python Style
      • Type Hints
      • Docstrings
    • Testing Guidelines
      • Test Organization
      • Test Requirements
      • Running Tests
    • Documentation
      • Building Docs Locally
      • Documentation Standards
    • Pull Request Process
      • 1. Create Branch
      • 2. Make Changes
      • 3. Commit
      • 4. Push and Create PR
      • 5. Review Process
    • Release Process
      • Pre-Release Checklist
      • Step-by-Step Release Process
        • 1. Update Version Numbers
        • 2. Commit Version Updates
        • 3. Create and Push Tag
    • Getting Help
    • Code of Conduct
      • Our Standards
      • Unacceptable Behavior
    • License
    • Recognition
    • See Also
Genro-Toolbox
  • Search


© Copyright 2025, Genropy Team.

Built with Sphinx using a theme provided by Read the Docs.