Files

2969 lines
79 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="../../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.23">
<title>Models - Khata App — Library Reference</title>
<link rel="stylesheet" href="../../../../assets/stylesheets/main.84d31ad4.min.css">
<link rel="stylesheet" href="../../../../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,300i,400,400i,700,700i%7CJetBrains+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Inter";--md-code-font:"JetBrains Mono"}</style>
<link rel="stylesheet" href="../../../../assets/_mkdocstrings.css">
<link rel="stylesheet" href="https://unpkg.com/dracula-prism/dist/css/dracula-prism.css">
<script>__md_scope=new URL("../../../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="cyan">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#models" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../../../.." title="Khata App — Library Reference" class="md-header__button md-logo" aria-label="Khata App — Library Reference" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 8c0 2.21-1.79 4-4 4s-4-1.79-4-4 1.79-4 4-4 4 1.79 4 4m0 6.72V20H0v-2c0-2.21 3.13-4 7-4 1.5 0 2.87.27 4 .72M24 20H13V3h11zm-8-8.5a2.5 2.5 0 0 1 5 0 2.5 2.5 0 0 1-5 0M22 7a2 2 0 0 1-2-2h-3c0 1.11-.89 2-2 2v9a2 2 0 0 1 2 2h3c0-1.1.9-2 2-2z"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Khata App — Library Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Models
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="deep-purple" data-md-color-accent="cyan" aria-hidden="true" type="radio" name="__palette" id="__palette_0">
</form>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<a href="javascript:void(0)" class="md-search__icon md-icon" title="Share" aria-label="Share" data-clipboard data-clipboard-text="" data-md-component="search-share" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.15c-.05.21-.08.43-.08.66 0 1.61 1.31 2.91 2.92 2.91s2.92-1.3 2.92-2.91A2.92 2.92 0 0 0 18 16.08"/></svg>
</a>
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../../../.." title="Khata App — Library Reference" class="md-nav__button md-logo" aria-label="Khata App — Library Reference" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 8c0 2.21-1.79 4-4 4s-4-1.79-4-4 1.79-4 4-4 4 1.79 4 4m0 6.72V20H0v-2c0-2.21 3.13-4 7-4 1.5 0 2.87.27 4 .72M24 20H13V3h11zm-8-8.5a2.5 2.5 0 0 1 5 0 2.5 2.5 0 0 1-5 0M22 7a2 2 0 0 1-2-2h-3c0 1.11-.89 2-2 2v9a2 2 0 0 1 2 2h3c0-1.1.9-2 2-2z"/></svg>
</a>
Khata App — Library Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../../.." class="md-nav__link">
<span class="md-ellipsis">
Home
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2" >
<div class="md-nav__link md-nav__container">
<a href="../../../../domain/" class="md-nav__link ">
<span class="md-ellipsis">
Domain
</span>
</a>
<label class="md-nav__link " for="__nav_2" id="__nav_2_label" tabindex="">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Domain
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../../../domain/enrichment/" class="md-nav__link">
<span class="md-ellipsis">
Enrichment
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../../../domain/fetch_pipeline/" class="md-nav__link">
<span class="md-ellipsis">
Fetch Pipeline
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../../../domain/fetch_request/" class="md-nav__link">
<span class="md-ellipsis">
Fetch Request
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3" >
<div class="md-nav__link md-nav__container">
<a href="../../../../infra/" class="md-nav__link ">
<span class="md-ellipsis">
Infra
</span>
</a>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Infra
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4" >
<div class="md-nav__link md-nav__container">
<a href="../../../../interfaces/" class="md-nav__link ">
<span class="md-ellipsis">
Interfaces
</span>
</a>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Interfaces
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
<div class="md-nav__link md-nav__container">
<a href="../../../" class="md-nav__link ">
<span class="md-ellipsis">
Pipelines
</span>
</a>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Pipelines
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models" class="md-nav__link">
<span class="md-ellipsis">
models
</span>
</a>
<nav class="md-nav" aria-label="models">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models--summary" class="md-nav__link">
<span class="md-ellipsis">
Summary
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models-classes" class="md-nav__link">
<span class="md-ellipsis">
Classes
</span>
</a>
<nav class="md-nav" aria-label="Classes">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.ArrayPattern" class="md-nav__link">
<span class="md-ellipsis">
ArrayPattern
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.BasePattern" class="md-nav__link">
<span class="md-ellipsis">
BasePattern
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.KeywordsPattern" class="md-nav__link">
<span class="md-ellipsis">
KeywordsPattern
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.MappingPattern" class="md-nav__link">
<span class="md-ellipsis">
MappingPattern
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.MappingValue" class="md-nav__link">
<span class="md-ellipsis">
MappingValue
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry" class="md-nav__link">
<span class="md-ellipsis">
PatternRegistry
</span>
</a>
<nav class="md-nav" aria-label="PatternRegistry">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry-functions" class="md-nav__link">
<span class="md-ellipsis">
Functions
</span>
</a>
<nav class="md-nav" aria-label="Functions">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry.array" class="md-nav__link">
<span class="md-ellipsis">
array
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry.get" class="md-nav__link">
<span class="md-ellipsis">
get
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry.keywords" class="md-nav__link">
<span class="md-ellipsis">
keywords
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry.mapping" class="md-nav__link">
<span class="md-ellipsis">
mapping
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry.regex" class="md-nav__link">
<span class="md-ellipsis">
regex
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry.regex_list" class="md-nav__link">
<span class="md-ellipsis">
regex_list
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry.regex_map" class="md-nav__link">
<span class="md-ellipsis">
regex_map
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry.rules" class="md-nav__link">
<span class="md-ellipsis">
rules
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternRegistry.template" class="md-nav__link">
<span class="md-ellipsis">
template
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.PatternType" class="md-nav__link">
<span class="md-ellipsis">
PatternType
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.RegexListPattern" class="md-nav__link">
<span class="md-ellipsis">
RegexListPattern
</span>
</a>
<nav class="md-nav" aria-label="RegexListPattern">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.RegexListPattern-functions" class="md-nav__link">
<span class="md-ellipsis">
Functions
</span>
</a>
<nav class="md-nav" aria-label="Functions">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.RegexListPattern.compile_all" class="md-nav__link">
<span class="md-ellipsis">
compile_all
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.RegexMapPattern" class="md-nav__link">
<span class="md-ellipsis">
RegexMapPattern
</span>
</a>
<nav class="md-nav" aria-label="RegexMapPattern">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.RegexMapPattern-functions" class="md-nav__link">
<span class="md-ellipsis">
Functions
</span>
</a>
<nav class="md-nav" aria-label="Functions">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.RegexMapPattern.compile_all" class="md-nav__link">
<span class="md-ellipsis">
compile_all
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.RegexPattern" class="md-nav__link">
<span class="md-ellipsis">
RegexPattern
</span>
</a>
<nav class="md-nav" aria-label="RegexPattern">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.RegexPattern-functions" class="md-nav__link">
<span class="md-ellipsis">
Functions
</span>
</a>
<nav class="md-nav" aria-label="Functions">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.RegexPattern.compile" class="md-nav__link">
<span class="md-ellipsis">
compile
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.RulesPattern" class="md-nav__link">
<span class="md-ellipsis">
RulesPattern
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#pipelines.enrichment.shared.models.TemplatePattern" class="md-nav__link">
<span class="md-ellipsis">
TemplatePattern
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="models">Models</h1>
<div class="doc doc-object doc-module">
<h2 id="pipelines.enrichment.shared.models" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code> <span class="doc doc-object-name doc-module-name">pipelines.enrichment.shared.models</span>
</h2>
<div class="doc doc-contents first">
<h3 id="pipelines.enrichment.shared.models--summary">Summary</h3>
<p>Pattern model family + <code>PatternRegistry</code> (port of <code>domain/enrichment/models.py</code>).</p>
<hr />
<p>The registry is loaded from the family <code>resources/patterns/*.yaml</code> files and
injected into every dagpipe stage node via <code>set_registry</code>.</p>
<div class="doc doc-children">
<h3 id="pipelines.enrichment.shared.models-classes">Classes</h3>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.ArrayPattern" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">ArrayPattern</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="pipelines.enrichment.shared.models.BasePattern" href="#pipelines.enrichment.shared.models.BasePattern">BasePattern</a></code></p>
<p>Array pattern: a plain list of values.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.ArrayPattern.type">type</span></code></td>
<td>
<code><span title="typing.Literal">Literal</span>[<span title="pipelines.enrichment.shared.models.PatternType.ARRAY">ARRAY</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Fixed discriminator.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.ArrayPattern.array">array</span></code></td>
<td>
<code><span title="typing.List">List</span></code>
</td>
<td>
<div class="doc-md-description">
<p>Plain value list.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.BasePattern" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">BasePattern</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p>
<p>Base model for all patterns: a discriminated <code>type</code> tag.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.BasePattern.type">type</span></code></td>
<td>
<code><a class="autorefs autorefs-internal" title="pipelines.enrichment.shared.models.PatternType" href="#pipelines.enrichment.shared.models.PatternType">PatternType</a></code>
</td>
<td>
<div class="doc-md-description">
<p>Pattern kind discriminator.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.KeywordsPattern" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">KeywordsPattern</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="pipelines.enrichment.shared.models.BasePattern" href="#pipelines.enrichment.shared.models.BasePattern">BasePattern</a></code></p>
<p>Keywords pattern: a flat list of keywords.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.KeywordsPattern.type">type</span></code></td>
<td>
<code><span title="typing.Literal">Literal</span>[<span title="pipelines.enrichment.shared.models.PatternType.KEYWORDS">KEYWORDS</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Fixed discriminator.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.KeywordsPattern.items">items</span></code></td>
<td>
<code><span title="typing.List">List</span>[str]</code>
</td>
<td>
<div class="doc-md-description">
<p>Keyword list.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.MappingPattern" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">MappingPattern</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="pipelines.enrichment.shared.models.BasePattern" href="#pipelines.enrichment.shared.models.BasePattern">BasePattern</a></code></p>
<p>Enumerated <code>mapping</code> of token → value.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.MappingPattern.type">type</span></code></td>
<td>
<code><span title="typing.Literal">Literal</span>[<span title="pipelines.enrichment.shared.models.PatternType.MAPPING">MAPPING</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Fixed discriminator.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.MappingPattern.mapping">mapping</span></code></td>
<td>
<code><span title="typing.Dict">Dict</span>[str, <span title="typing.Union">Union</span>[str, <a class="autorefs autorefs-internal" title="pipelines.enrichment.shared.models.MappingValue" href="#pipelines.enrichment.shared.models.MappingValue">MappingValue</a>, <span title="typing.List">List</span>]]</code>
</td>
<td>
<div class="doc-md-description">
<p>Token mapping.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.MappingValue" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">MappingValue</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p>
<p>Named value inside a mapping pattern.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.MappingValue.id">id</span></code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Mapping key id.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.MappingValue.name">name</span></code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Display name.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.PatternRegistry" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">PatternRegistry</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><span title="pydantic.BaseModel">BaseModel</span></code></p>
<p>Loaded pattern registry injected into dagpipe stage nodes.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.PatternRegistry.version">version</span></code></td>
<td>
<code>int</code>
</td>
<td>
<div class="doc-md-description">
<p>Registry schema version.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.PatternRegistry.patterns">patterns</span></code></td>
<td>
<code><span title="typing.Dict">Dict</span>[str, <span title="pipelines.enrichment.shared.models.Pattern">Pattern</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Name → pattern.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
<h5 id="pipelines.enrichment.shared.models.PatternRegistry-functions">Functions</h5>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.PatternRegistry.array" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">array</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">array</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Return the raw array of an ArrayPattern.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>name</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Pattern name.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Name</th> <th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>List</code></td> <td>
<code><span title="typing.List">List</span></code>
</td>
<td>
<div class="doc-md-description">
<p>The array items.</p>
</div>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Raises:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code>TypeError</code>
</td>
<td>
<div class="doc-md-description">
<p>When the pattern is not an ArrayPattern.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.PatternRegistry.get" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">get</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">get</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Pattern</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Look up a pattern by name.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>name</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Pattern name.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Name</th> <th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>Pattern</code></td> <td>
<code><span title="pipelines.enrichment.shared.models.Pattern">Pattern</span></code>
</td>
<td>
<div class="doc-md-description">
<p>The stored pattern object.</p>
</div>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Raises:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code>KeyError</code>
</td>
<td>
<div class="doc-md-description">
<p>When the pattern name is not registered.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.PatternRegistry.keywords" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">keywords</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">keywords</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Return the keyword list of a KeywordsPattern.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>name</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Pattern name.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.List">List</span>[str]</code>
</td>
<td>
<div class="doc-md-description">
<p>List[str]: The keyword items.</p>
</div>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Raises:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code>TypeError</code>
</td>
<td>
<div class="doc-md-description">
<p>When the pattern is not a KeywordsPattern.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.PatternRegistry.mapping" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">mapping</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">mapping</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">str</span><span class="p">]</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Return the token mapping of a MappingPattern.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>name</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Pattern name.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.Dict">Dict</span>[str, str]</code>
</td>
<td>
<div class="doc-md-description">
<p>Dict[str, str]: The mapping dict.</p>
</div>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Raises:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code>TypeError</code>
</td>
<td>
<div class="doc-md-description">
<p>When the pattern is not a MappingPattern.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.PatternRegistry.regex" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">regex</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">regex</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">re</span><span class="o">.</span><span class="n">Pattern</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Return the compiled regex of a RegexPattern.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>name</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Pattern name.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="re.Pattern">Pattern</span></code>
</td>
<td>
<div class="doc-md-description">
<p>re.Pattern: The compiled regex.</p>
</div>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Raises:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code>TypeError</code>
</td>
<td>
<div class="doc-md-description">
<p>When the pattern is not a RegexPattern.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.PatternRegistry.regex_list" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">regex_list</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">regex_list</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="n">re</span><span class="o">.</span><span class="n">Pattern</span><span class="p">]</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Return the compiled regexes of a RegexListPattern.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>name</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Pattern name.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.List">List</span>[<span title="re.Pattern">Pattern</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>List[re.Pattern]: The compiled regexes.</p>
</div>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Raises:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code>TypeError</code>
</td>
<td>
<div class="doc-md-description">
<p>When the pattern is not a RegexListPattern.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.PatternRegistry.regex_map" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">regex_map</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">regex_map</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="n">Tuple</span><span class="p">[</span><span class="n">re</span><span class="o">.</span><span class="n">Pattern</span><span class="p">,</span> <span class="nb">str</span><span class="p">]]</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Return the compiled <code>(regex, value)</code> pairs of a RegexMapPattern.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>name</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Pattern name.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.List">List</span>[<span title="typing.Tuple">Tuple</span>[<span title="re.Pattern">Pattern</span>, str]]</code>
</td>
<td>
<div class="doc-md-description">
<p>List[Tuple[re.Pattern, str]]: The compiled pairs.</p>
</div>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Raises:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code>TypeError</code>
</td>
<td>
<div class="doc-md-description">
<p>When the pattern is not a RegexMapPattern.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.PatternRegistry.rules" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">rules</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">rules</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="n">Dict</span><span class="p">]</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Return the rule list of a RulesPattern.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>name</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Pattern name.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.List">List</span>[<span title="typing.Dict">Dict</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>List[Dict]: The ordered rules.</p>
</div>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Raises:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code>TypeError</code>
</td>
<td>
<div class="doc-md-description">
<p>When the pattern is not a RulesPattern.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.PatternRegistry.template" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">template</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">template</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Return the format string of a TemplatePattern.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>name</code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Pattern name.</p>
</div>
</td>
<td>
<em>required</em>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Name</th> <th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>str</code></td> <td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>The template format string.</p>
</div>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Raises:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code>TypeError</code>
</td>
<td>
<div class="doc-md-description">
<p>When the pattern is not a TemplatePattern.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.PatternType" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">PatternType</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code>str</code>, <code><span title="enum.Enum">Enum</span></code></p>
<p>Supported pattern kinds loaded from the family pattern files.</p>
<div class="doc doc-children">
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.RegexListPattern" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">RegexListPattern</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="pipelines.enrichment.shared.models.BasePattern" href="#pipelines.enrichment.shared.models.BasePattern">BasePattern</a></code></p>
<p>List-of-regexes pattern.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.RegexListPattern.type">type</span></code></td>
<td>
<code><span title="typing.Literal">Literal</span>[<span title="pipelines.enrichment.shared.models.PatternType.REGEX_LIST">REGEX_LIST</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Fixed discriminator.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.RegexListPattern.patterns">patterns</span></code></td>
<td>
<code><span title="typing.List">List</span>[str]</code>
</td>
<td>
<div class="doc-md-description">
<p>Regex sources.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
<h5 id="pipelines.enrichment.shared.models.RegexListPattern-functions">Functions</h5>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.RegexListPattern.compile_all" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">compile_all</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">compile_all</span><span class="p">(</span><span class="n">flags</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">IGNORECASE</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="n">re</span><span class="o">.</span><span class="n">Pattern</span><span class="p">]</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Compile every regex source.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>flags</code></td>
<td>
<code>int</code>
</td>
<td>
<div class="doc-md-description">
<p>Compile flags, default <code>re.IGNORECASE</code>.</p>
</div>
</td>
<td>
<code><span title="re.IGNORECASE">IGNORECASE</span></code>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.List">List</span>[<span title="re.Pattern">Pattern</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>List[re.Pattern]: The compiled regexes.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.RegexMapPattern" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">RegexMapPattern</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="pipelines.enrichment.shared.models.BasePattern" href="#pipelines.enrichment.shared.models.BasePattern">BasePattern</a></code></p>
<p>Regex → value mapping pattern.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.RegexMapPattern.type">type</span></code></td>
<td>
<code><span title="typing.Literal">Literal</span>[<span title="pipelines.enrichment.shared.models.PatternType.REGEX_MAP">REGEX_MAP</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Fixed discriminator.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.RegexMapPattern.mapping">mapping</span></code></td>
<td>
<code><span title="typing.Dict">Dict</span>[str, str]</code>
</td>
<td>
<div class="doc-md-description">
<p>Regex source → value.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
<h5 id="pipelines.enrichment.shared.models.RegexMapPattern-functions">Functions</h5>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.RegexMapPattern.compile_all" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">compile_all</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span>
<span class="normal"><a href="#__codelineno-0-2">2</a></span>
<span class="normal"><a href="#__codelineno-0-3">3</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nf">compile_all</span><span class="p">(</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2"></a> <span class="n">flags</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">IGNORECASE</span><span class="p">,</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3"></a><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="n">Tuple</span><span class="p">[</span><span class="n">re</span><span class="o">.</span><span class="n">Pattern</span><span class="p">,</span> <span class="nb">str</span><span class="p">]]</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Pre-compile the mapping into <code>(regex, value)</code> pairs.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>flags</code></td>
<td>
<code>int</code>
</td>
<td>
<div class="doc-md-description">
<p>Compile flags, default <code>re.IGNORECASE</code>.</p>
</div>
</td>
<td>
<code><span title="re.IGNORECASE">IGNORECASE</span></code>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.List">List</span>[<span title="typing.Tuple">Tuple</span>[<span title="re.Pattern">Pattern</span>, str]]</code>
</td>
<td>
<div class="doc-md-description">
<p>List[Tuple[re.Pattern, str]]: The compiled pairs.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.RegexPattern" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">RegexPattern</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="pipelines.enrichment.shared.models.BasePattern" href="#pipelines.enrichment.shared.models.BasePattern">BasePattern</a></code></p>
<p>Single-regex pattern.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.RegexPattern.type">type</span></code></td>
<td>
<code><span title="typing.Literal">Literal</span>[<span title="pipelines.enrichment.shared.models.PatternType.REGEX">REGEX</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Fixed discriminator.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.RegexPattern.pattern">pattern</span></code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Regex source.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
<h5 id="pipelines.enrichment.shared.models.RegexPattern-functions">Functions</h5>
<div class="doc doc-object doc-function">
<h6 id="pipelines.enrichment.shared.models.RegexPattern.compile" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">compile</span>
</h6>
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="nb">compile</span><span class="p">(</span><span class="nf">flags</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">IGNORECASE</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">re</span><span class="o">.</span><span class="n">Pattern</span>
</span></code></pre></div></td></tr></table></div>
<div class="doc doc-contents ">
<p>Compile the regex pattern.</p>
<p><span class="doc-section-title">Parameters:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>flags</code></td>
<td>
<code>int</code>
</td>
<td>
<div class="doc-md-description">
<p>Compile flags, default <code>re.IGNORECASE</code>.</p>
</div>
</td>
<td>
<code><span title="re.IGNORECASE">IGNORECASE</span></code>
</td>
</tr>
</tbody>
</table>
<p><span class="doc-section-title">Returns:</span></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="re.Pattern">Pattern</span></code>
</td>
<td>
<div class="doc-md-description">
<p>re.Pattern: The compiled regex.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.RulesPattern" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">RulesPattern</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="pipelines.enrichment.shared.models.BasePattern" href="#pipelines.enrichment.shared.models.BasePattern">BasePattern</a></code></p>
<p>Rule-set pattern: ordered flag rules with emit payloads.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.RulesPattern.type">type</span></code></td>
<td>
<code><span title="typing.Literal">Literal</span>[<span title="pipelines.enrichment.shared.models.PatternType.RULES">RULES</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Fixed discriminator.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.RulesPattern.rules">rules</span></code></td>
<td>
<code><span title="typing.List">List</span>[<span title="typing.Dict">Dict</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Ordered rule dicts.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h4 id="pipelines.enrichment.shared.models.TemplatePattern" class="doc doc-heading">
<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code> <span class="doc doc-object-name doc-class-name">TemplatePattern</span>
</h4>
<div class="doc doc-contents ">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="pipelines.enrichment.shared.models.BasePattern" href="#pipelines.enrichment.shared.models.BasePattern">BasePattern</a></code></p>
<p>String-template pattern.</p>
<p><span class="doc-section-title">Attributes:</span></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.TemplatePattern.type">type</span></code></td>
<td>
<code><span title="typing.Literal">Literal</span>[<span title="pipelines.enrichment.shared.models.PatternType.TEMPLATE">TEMPLATE</span>]</code>
</td>
<td>
<div class="doc-md-description">
<p>Fixed discriminator.</p>
</div>
</td>
</tr>
<tr class="doc-section-item">
<td><code><span title="pipelines.enrichment.shared.models.TemplatePattern.format">format</span></code></td>
<td>
<code>str</code>
</td>
<td>
<div class="doc-md-description">
<p>Format/template string.</p>
</div>
</td>
</tr>
</tbody>
</table>
<div class="doc doc-children">
</div>
</div>
</div>
</div>
</div>
</div>
</article>
</div>
<script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
Back to top
</button>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../../../..", "features": ["navigation.sections", "navigation.expand", "navigation.top", "navigation.instant", "navigation.tracking", "navigation.indexes", "content.code.copy", "content.code.annotate", "content.tabs.link", "content.action.edit", "search.highlight", "search.share", "search.suggest"], "search": "../../../../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
<script src="../../../../assets/javascripts/bundle.f55a23d4.min.js"></script>
</body>
</html>