{"id":421,"library":"uritemplate","title":"uritemplate","description":"A Python library for implementing RFC 6570 URI Templates, currently at version 4.2.0, with a release cadence of approximately every 1-2 years.","status":"active","version":"4.2.0","language":"python","source_language":"en","source_url":"https://github.com/python-hyper/uritemplate","tags":["URI Templates","RFC 6570","Python"],"install":[{"cmd":"pip install uritemplate","lang":"bash","label":"Install uritemplate"}],"dependencies":[{"reason":"Optional, for making HTTP requests with expanded URIs","package":"requests","optional":true}],"imports":[{"note":"Direct import of 'expand' function from 'uritemplate' module.","symbol":"expand","correct":"from uritemplate import expand"},{"note":"Direct import of 'URITemplate' class from 'uritemplate' module.","symbol":"URITemplate","correct":"from uritemplate import URITemplate"}],"quickstart":{"code":"from uritemplate import expand\n\nuri = 'https://api.github.com{/user}'\n\nexpanded_uri = expand(uri, user='sigmavirus24')\nprint(expanded_uri)","lang":"python","description":"Expands a URI template with a user variable using the 'expand' function from 'uritemplate'."},"warnings":[{"fix":"Update import statements to 'from uritemplate import expand' and 'from uritemplate import URITemplate'.","message":"Direct import of 'expand' and 'URITemplate' from 'uritemplate' module is required; previous import paths may be deprecated.","severity":"breaking","affected_versions":"4.2.0"},{"fix":"Ensure consistency between 'var_dict' and 'kwargs' to avoid unintentional overrides.","message":"Passing values by both 'var_dict' and 'kwargs' in 'expand' function may override values in 'var_dict'.","severity":"gotcha","affected_versions":"4.2.0"}],"env_vars":null,"search_vec":"'-2':23 '1':22 '4.2.0':14 '6570':8,28 'approxim':20 'cadenc':18 'current':11 'everi':21 'implement':6 'librari':4 'python':3,29 'releas':17 'rfc':7,27 'templat':10,26 'uri':9,25 'uritempl':1 'version':13 'year':24","created_at":"2026-03-28T11:15:54.939244+00:00","updated_at":"2026-04-16T23:59:40.036473+00:00","problems":[{"fix":"pip install uritemplate","cause":"The 'uritemplate' library is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'uritemplate'"},{"fix":"template.expand({'variable': 'value'})","cause":"The `expand` method of a URITemplate object was called without the required dictionary of variables or with a non-dictionary positional argument.","error":"TypeError: expand() missing 1 required positional argument: 'var_dict'"},{"fix":"template.expand({'variable': 'value'})","cause":"The `expand` method was called with `None` as the argument for variables, which is not an iterable type like a dictionary.","error":"TypeError: argument of type 'NoneType' is not iterable"},{"fix":"template = uritemplate.URITemplate('/path/{foo}')","cause":"The URI template string contains a syntax error, such as a missing closing brace or an invalid expression, violating RFC 6570.","error":"Missing '}' in URI template segment '{foo'"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"4.2.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://uritemplate.readthedocs.org","github":"https://github.com/python-hyper/uritemplate","docs":null,"changelog":null,"pypi":"https://pypi.org/project/uritemplate/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-27","next_check":"2026-07-28","install_tag":"verified"}}