MCPcopy Index your code
hub / github.com/theskumar/python-dotenv / parse_variables

Function parse_variables

src/dotenv/variables.py:70–86  ·  view source on GitHub ↗
(value: str)

Source from the content-addressed store, hash-verified

68
69
70def parse_variables(value: str) -> Iterator[Atom]:
71 cursor = 0
72
73 for match in _posix_variable.finditer(value):
74 (start, end) = match.span()
75 name = match["name"]
76 default = match["default"]
77
78 if start > cursor:
79 yield Literal(value=value[cursor:start])
80
81 yield Variable(name=name, default=default)
82 cursor = end
83
84 length = len(value)
85 if cursor < length:
86 yield Literal(value=value[cursor:length])

Callers 2

test_parse_variablesFunction · 0.90
resolve_variablesFunction · 0.85

Calls 2

LiteralClass · 0.85
VariableClass · 0.85

Tested by 1

test_parse_variablesFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…