Skip to content

Frameprops Tool API

API for extending the Frameprops Tool, which allows you to customize how frame properties are displayed and categorized.


Core Classes

Hook


Core Classes

Classes

CategoryMatcher

CategoryMatcher(
    *,
    name: str,
    priority: int = 0,
    order: int = 0,
    exact_matches: set[str] = set(),
    prefixes: set[str] = set(),
    suffixes: set[str] = set(),
)

Defines how to match properties to a category.

Attributes
name
name: str

Display name of the category.

priority
priority: int = 0

Priority for matching. Higher priority is checked first.

order
order: int = 0

Display order in the tree view. Lower values appear first.

exact_matches
exact_matches: set[str] = field(default_factory=set)

Exact property keys that belong to this category.

prefixes
prefixes: set[str] = field(default_factory=set)

Property key prefixes that belong to this category.

suffixes
suffixes: set[str] = field(default_factory=set)

Property key suffixes that belong to this category.

Functions
matches
matches(prop_key: str) -> bool

Check if a property key matches this category.

Source code in src/vsview/app/tools/frameprops/categories.py
def matches(self, prop_key: str) -> bool:
    """Check if a property key matches this category."""

    if prop_key in self.exact_matches:
        return True

    for prefix in self.prefixes:
        if prop_key.startswith(prefix):
            return True

    return any(prop_key.endswith(suffix) for suffix in self.suffixes)

FormatterProperty

FormatterProperty(
    *,
    prop_key: str,
    value_formatter: Callable[[Any], str] | dict[Hashable, str] | None = None,
)

Defines how to format a property for display.

Attributes
prop_key
prop_key: str

The property key this formatter applies to.

value_formatter
value_formatter: Callable[[Any], str] | dict[Hashable, str] | None = None

Optional value formatter:

  • Callable: Transform the value to a string
  • dict: Map values to strings (for enums/lookups)
  • None: Use default str() conversion

Hook

Attributes

hookimpl

hookimpl = HookimplMarker('vsview.frameprops')