Skip to content
New: Star-import, signal unraveling, Python 3.12 support, and more

# tagging module

Utilities for working with tags.

## match_tags function

    match_tags(
        tags,
        in_tags
    )

Match tags in `tags` to that in `in_tags`.

Multiple tags in `tags` are combined using OR rule, that is, returns True if any of them is found in `in_tags`. If any tag is not an identifier, evaluates it as a boolean expression. All tags in `in_tags` must be identifiers.

Usage

    >>> from vectorbtpro.utils.tagging import match_tags

    >>> match_tags('hello', 'hello')
    True
    >>> match_tags('hello', 'world')
    False
    >>> match_tags(['hello', 'world'], 'world')
    True
    >>> match_tags('hello', ['hello', 'world'])
    True
    >>> match_tags('hello and world', ['hello', 'world'])
    True
    >>> match_tags('hello and not world', ['hello', 'world'])
    False

#### Cookie consent

We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.

- Google Analytics
- GitHub

Manage settings