MCPcopy Create free account
hub / github.com/python-hyper/uritemplate / variables

Function variables

uritemplate/api.py:70–86  ·  view source on GitHub ↗

Parse the variables of the template. This returns all of the variable names in the URI Template. :returns: Set of variable names :rtype: set Example:: variables('https://api.github.com{/end}) # => {'end'} variables('https://api.github.com/repos{/username}{

(uri: str)

Source from the content-addressed store, hash-verified

68
69
70def variables(uri: str) -> OrderedSet:
71 """Parse the variables of the template.
72
73 This returns all of the variable names in the URI Template.
74
75 :returns: Set of variable names
76 :rtype: set
77
78 Example::
79
80 variables('https://api.github.com{/end})
81 # => {'end'}
82 variables('https://api.github.com/repos{/username}{/repository}')
83 # => {'username', 'repository'}
84
85 """
86 return OrderedSet(URITemplate(uri).variable_names)

Callers 1

test_variablesMethod · 0.90

Calls 2

OrderedSetClass · 0.90
URITemplateClass · 0.90

Tested by 1

test_variablesMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…