1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-uritemplate
7 SDESC[py38]= URI templates (PY38)
8 SDESC[py39]= URI templates (PY39)
9 HOMEPAGE= https://uritemplate.readthedocs.org
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/bf/0c/60d82c077998feb631608dca3cc1fe19ac074e772bf0c24cf409b977b815
14 DISTFILE[1]= uritemplate-3.0.1-py2.py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY38 PY39
20 OPTIONS_STANDARD= none
21 VOPTS[py38]= PY38=ON PY39=OFF
22 VOPTS[py39]= PY38=OFF PY39=ON
24 DISTNAME= uritemplate-3.0.1.dist-info
28 [PY38].USES_ON= python:py38,wheel
30 [PY39].USES_ON= python:py39,wheel
32 [FILE:2495:descriptions/desc.single]
36 Documentation_ -- GitHub_ -- Travis-CI_
38 Simple python library to deal with `URI Templates`_. The API looks like
40 .. code-block:: python
42 from uritemplate import URITemplate, expand
44 # NOTE: URI params must be strings not integers
46 gist_uri = 'https://api.github.com/users/sigmavirus24/gists{/gist_id}'
47 t = URITemplate(gist_uri)
48 print(t.expand(gist_id='123456'))
49 # => https://api.github.com/users/sigmavirus24/gists/123456
52 print(expand(gist_uri, gist_id='123456'))
55 t.expand({'gist_id': '123456'})
56 print(expand(gist_uri, {'gist_id': '123456'}))
58 Where it might be useful to have a class
60 .. code-block:: python
64 class GitHubUser(object):
65 url = URITemplate('https://api.github.com/user{/login}')
66 def __init__(self, name):
67 self.api_url = url.expand(login=name)
68 response = requests.get(self.api_url)
69 if response.status_code == 200:
70 self.__dict__.update(response.json())
72 When the module containing this class is loaded, ``GitHubUser.url`` is
73 evaluated and so the template is created once. It's often hard to notice in
75 Python, but object creation can consume a great deal of time and so can the
77 re module which uritemplate relies on. Constructing the object once should
78 reduce the amount of time your code takes to run.
85 pip install uritemplate
92 .. _Documentation: https://uritemplate.readthedocs.io/
93 .. _GitHub: https://github.com/python-hyper/uritemplate
94 .. _Travis-CI: https://travis-ci.org/python-hyper/uritemplate
95 .. _URI Templates: http://tools.ietf.org/html/rfc6570
97 https://github.com/python-hyper/uritemplate/blob/master/LICENSE
99 Changelog - uritemplate
100 =======================
105 - Update to Python 3.6, 3.7, and 3.8
106 - Drop support for Python 2.6, 3.2, and 3.3
107 - Ignore None in list argument expansion
108 - Handle a list with an empty string appropriately
113 - Match major version number of uritemplate.py
118 - Merge uritemplate.py into uritemplate
120 Changelog - uritemplate.py
121 ==========================
126 - Fix meta-package requirements.
131 - Deprecate in favor of uritemplate. This package is now a metapackage that
132 depends on uritemplate.
136 07620c3f3f8eed1f12600845892b0e036a2420acf513c53f7de0abd911a5894f 15615 uritemplate-3.0.1-py2.py3-none-any.whl