# attributes

URL: /kida/api/analysis/attributes/
Section: analysis
Description: Static extraction of literal HTML attributes from template data nodes.

---

> For a complete page index, fetch /kida/llms.txt.

Open LLM text
(/kida/api/analysis/attributes/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fanalysis%2Fattributes%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fanalysis%2Fattributes%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fanalysis%2Fattributes%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fanalysis%2Fattributes%2Findex.txt)

Module

#
`analysis.attributes`

Static extraction of literal HTML attributes from template data nodes.

1Class2Functions

## Classes

`LiteralAttribute`

6

▼

Literal HTML attribute found in static template text.

Literal HTML attribute found in static template text.

#### Attributes

Name
Type
Description

`name`

`str`

—

`value`

`str | None`

—

`tag`

`str`

—

`template_name`

`str | None`

—

`lineno`

`int | None`

—

`col_offset`

`int | None`

—

## Functions

`_line_col`

4

`tuple[int, int]`

▼

Return 1-based line and 0-based column for an offset in a data node.

`def _line_col(base_line: int, base_col: int, text: str, offset: int) -> tuple[int, int]`

##### Parameters

Name
Type
Description

`base_line`
`int`

`base_col`
`int`

`text`
`str`

`offset`
`int`

##### Returns

`tuple[int, int]`

`extract_literal_attributes`

3

`list[LiteralAttribute]`

▼

Extract literal HTML attributes from static template text.

Dynamic attributes …

`def extract_literal_attributes(template_or_ast: Any, *, names: Iterable[str] | None = None, prefixes: Iterable[str] | None = None) -> list[LiteralAttribute]`

Extract literal HTML attributes from static template text.

Dynamic attributes built through expressions, filters, or helpers are not
inferred. This helper intentionally reports only facts visible in raw
template text so framework adapters can layer their own semantics on top.

##### Parameters

Name
Type
Description

`template_or_ast`
`Any`

`names`
`Iterable[str] | None`

Default:`None`

`prefixes`
`Iterable[str] | None`

Default:`None`

##### Returns

`list[LiteralAttribute]`
