Genro-Toolbox
Essential utilities for the Genro ecosystem (Genro Kyō)
Genro-Toolbox is a lightweight, zero-dependency Python library providing core utilities for Genro Kyō (genro-asgi, genro-routes, genro-api, etc.). Think of it as the foundation from which Genro solutions are built.
Features
SmartOptions- Intelligent options merging with filtering and defaultsTreeDict- Hierarchical dictionary with dot notation path accessDictObj- Dict subclass with dot-access for attribute-style read/writeextract_kwargs- Decorator for extracting and grouping keyword arguments by prefixdictExtract- Extract dict items by key prefixsmartsplit- Split strings honoring escaped separatorstags_match- Boolean expression matcher for tag-based filteringget_uuid- Sortable 22-char unique identifiers for distributed systemssmartasync- Unified sync/async API decorator with automatic context detectionsmarttimer- Non-blocking timers (set_timeout/set_interval) with sync/async detectionsafe_is_instance- Type checking without importsascii_table- Beautiful ASCII and Markdown tables with formatting and hierarchiesZero dependencies - Pure Python standard library only (optional: tomli, pyyaml)
Full type hints - Complete typing support
Python 3.10+ - Modern Python
Quick Example
from genro_toolbox import extract_kwargs
@extract_kwargs(logging=True, cache=True)
def setup_service(name, logging_kwargs=None, cache_kwargs=None, **kwargs):
print(f"Logging config: {logging_kwargs}")
print(f"Cache config: {cache_kwargs}")
# All these styles work:
setup_service(
name="api",
logging_level="INFO", # → logging_kwargs={'level': 'INFO'}
cache_ttl=300, # → cache_kwargs={'ttl': 300}
)
setup_service(
name="api",
logging={'level': 'INFO'}, # Dict style
cache=True # Boolean activation
)
Part of Genro Kyō
Genro-Toolbox is part of Genro Kyō.
License
Apache License 2.0 - Copyright © 2025 Softwell Srl