Skip to content

Support

The Support module contains shared utilities that other Titanspan modules can use without importing database, queue, AI, or web infrastructure.

The current implementation includes:

  • Arr helpers for Python mappings, sequences, and iterables.
  • Shared value, nested-data, escaping, and exception helpers.
  • Fluent for typed, mutable attribute data and nested path access.
  • ForwardsCalls for explicit delegation from wrappers to composed objects.
  • Optional for null-safe access and explicit method delegation.
  • Env and env for normalized process environment access, scoped adapters, and explicit dotenv file updates.
  • Str for tested string transformations and validators.
  • Stringable for explicit chainable transformations over Str.
  • Number for locale-aware formatting, parsing, spelling, and summaries; Babel and num2words are mandatory runtime dependencies.
  • BinaryCodec for UUID and ULID conversion between text and 16-byte identifiers, with process-local custom codec registration.
  • ConfigurationUrlParser for database connection URLs, nested query options, driver aliases, and SQL Server DSN parsing.
  • NamespacedItemResolver for resolving dotted and namespaced keys with a per-instance parsed-value cache.
  • HtmlString and EncodedHtmlString for trusted markup and escaped text.
  • MessageBag for keyed messages, wildcard reads, formatting, and JSON output.
  • Benchmark, InteractsWithTime, Lottery, Sleep, and Timebox for measured execution, deadlines, probabilistic callbacks, explicit waiting, and minimum-duration operations.
  • Uri and UriQueryString for immutable URL components and nested query data, with Starlette redirect interoperability.
  • Macroable for explicit, typed macro registration and invocation.
  • Conditionable for synchronous and asynchronous conditional callbacks.
  • Tappable for callback observation while preserving instance identity.

These APIs follow Titanspan’s native Python specifications. They use Python collections, object protocols, and explicit method dispatch instead of emulating language-specific constructs from another ecosystem. The Support specification records ownership and verification boundaries.

from titanspan.support import Arr, Conditionable, ForwardsCalls, Macroable

Value helpers are available from the same package:

from titanspan.support import blank, data_get, env, optional, tap
profile = {"user": {"name": "Ada"}}
assert data_get(profile, "user.name") == "Ada"
assert blank(" ")
assert optional(None).get("name") is None
debug = env("TITANSPAN_DEBUG", False)

Support uses mandatory Babel and num2words for Number operations and remains independent of Database, Queue, and AI modules. URI redirects reuse the Starlette version already installed through the web foundation; URI parsing and encoding otherwise use the Python standard library and Titanspan’s Arr helpers.

Support is under active development. The native specification and focused test suites describe implemented behavior. Do not infer availability from similar names in other libraries or from roadmap entries.

See arrays, environment utilities, Fluent, forwarded calls, helpers, message bags, optional values, strings, and extensions for the implemented surface. See URI utilities and fluent strings for the implemented Stringable methods and their Python behavior, HTML values for context-aware rendering guidance, timing utilities for Benchmark, InteractsWithTime, Lottery, and Timebox, and Sleep for explicit synchronous and asynchronous waiting. See Number utilities for numeric formatting, locale scopes, and Python-specific behavior, and binary codecs for UUID and ULID conversion. See configuration URLs for parsing database URLs and SQL Server DSN values, and namespaced item keys for dotted-key parsing and cache control.