1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-uritemplate
7 SDESC[py37]= URI templates (PY37)
8 SDESC[py38]= URI templates (PY38)
9 HOMEPAGE= https://uritemplate.readthedocs.org
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPI/u/uritemplate
14 DISTFILE[1]= uritemplate-3.0.1.tar.gz:main
19 OPTIONS_AVAILABLE= PY38 PY37
20 OPTIONS_STANDARD= none
21 VOPTS[py37]= PY38=OFF PY37=ON
22 VOPTS[py38]= PY38=ON PY37=OFF
24 DISTNAME= uritemplate-3.0.1
28 [PY37].USES_ON= python:py37
30 [PY38].USES_ON= python:py38
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 5af8ad10cec94f215e3f48112de2022e1d5a37ed427fbd88652fa908f2ab7cae 32806 uritemplate-3.0.1.tar.gz