Identity
pipelines.enrichment.shared.identity
Summary
Entity identity helpers (port of domain/enrichment/entity/identity.py).
Functions
build_entity
Build the entity payload dict from name, type and logo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
Entity display name. |
required |
entity_type |
str
|
Entity type key, defaults to "merchant". |
'merchant'
|
entity_logo |
str | None
|
Logo URL, or None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Entity payload with |
canonicalize_candidate
Canonicalize a candidate value via normalize_key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
candidate |
str | None
|
Raw candidate, or None/empty. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The normalized candidate, or None when |
normalize_key
Normalize a key: NFKC, lowercase and stripped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text |
str | None
|
Raw key, or None. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The normalized key, or None when |
to_entity_id
Build the canonical snake-cased entity id from a name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str | None
|
Raw entity name, or None/empty. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The snake-cased entity id, or None when |