{"id":13494985,"url":"https://github.com/python-hyper/uritemplate","last_synced_at":"2025-05-14T05:10:33.422Z","repository":{"id":8462696,"uuid":"10060003","full_name":"python-hyper/uritemplate","owner":"python-hyper","description":"URI template parsing per RFC6570","archived":false,"fork":false,"pushed_at":"2025-03-31T20:01:30.000Z","size":240,"stargazers_count":238,"open_issues_count":11,"forks_count":32,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-04T01:45:05.167Z","etag":null,"topics":["python","rfc6570","uri","uritemplate"],"latest_commit_sha":null,"homepage":"https://uritemplate.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-hyper.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-05-14T16:52:08.000Z","updated_at":"2025-04-28T07:55:28.000Z","dependencies_parsed_at":"2023-02-19T15:15:19.425Z","dependency_job_id":"e3e46959-4884-458a-ad03-7dd55bf2f742","html_url":"https://github.com/python-hyper/uritemplate","commit_stats":{"total_commits":178,"total_committers":20,"mean_commits":8.9,"dds":0.4943820224719101,"last_synced_commit":"9559fe843088fbce3fe0e313fbd1204f2190ccef"},"previous_names":["sigmavirus24/uritemplate"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-hyper%2Furitemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-hyper%2Furitemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-hyper%2Furitemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-hyper%2Furitemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-hyper","download_url":"https://codeload.github.com/python-hyper/uritemplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253505559,"owners_count":21918932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","rfc6570","uri","uritemplate"],"created_at":"2024-07-31T19:01:30.109Z","updated_at":"2025-05-14T05:10:33.394Z","avatar_url":"https://github.com/python-hyper.png","language":"Python","funding_links":[],"categories":["Python","URL Utilities"],"sub_categories":[],"readme":"uritemplate\n===========\n\nDocumentation_ -- GitHub_ -- Travis-CI_\n\nSimple python library to deal with `URI Templates`_. The API looks like\n\n.. code-block:: python\n\n    from uritemplate import URITemplate, expand\n\n    # NOTE: URI params must be strings not integers\n\n    gist_uri = 'https://api.github.com/users/sigmavirus24/gists{/gist_id}'\n    t = URITemplate(gist_uri)\n    print(t.expand(gist_id='123456'))\n    # =\u003e https://api.github.com/users/sigmavirus24/gists/123456\n\n    # or\n    print(expand(gist_uri, gist_id='123456'))\n\n    # also\n    t.expand({'gist_id': '123456'})\n    print(expand(gist_uri, {'gist_id': '123456'}))\n\nWhere it might be useful to have a class\n\n.. code-block:: python\n\n    import requests\n\n    class GitHubUser(object):\n        url = URITemplate('https://api.github.com/user{/login}')\n        def __init__(self, name):\n            self.api_url = url.expand(login=name)\n            response = requests.get(self.api_url)\n            if response.status_code == 200:\n                self.__dict__.update(response.json())\n\nWhen the module containing this class is loaded, ``GitHubUser.url`` is\nevaluated and so the template is created once. It's often hard to notice in\nPython, but object creation can consume a great deal of time and so can the\n``re`` module which uritemplate relies on. Constructing the object once should\nreduce the amount of time your code takes to run.\n\nInstalling\n----------\n\n::\n\n    pip install uritemplate\n\nLicense\n-------\n\nModified BSD license_\n\n\n.. _Documentation: https://uritemplate.readthedocs.io/\n.. _GitHub: https://github.com/python-hyper/uritemplate\n.. _Travis-CI: https://travis-ci.org/python-hyper/uritemplate\n.. _URI Templates: https://tools.ietf.org/html/rfc6570\n.. _license: https://github.com/python-hyper/uritemplate/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-hyper%2Furitemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-hyper%2Furitemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-hyper%2Furitemplate/lists"}