Ravenports generated: 16 Nov 2022 02:19
[ravenports.git] / bucket_92 / python-uritemplate
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-uritemplate
4 VERSION=                4.1.1
5 KEYWORDS=               python
6 VARIANTS=               py39 py310
7 SDESC[py310]=           Implementation of RFC 6570 URI Templates (3.10)
8 SDESC[py39]=            Implementation of RFC 6570 URI Templates (3.9)
9 HOMEPAGE=               https://uritemplate.readthedocs.org
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/81/c0/7461b49cd25aeece13766f02ee576d1db528f1c37ce69aee300e075b485b
14 DISTFILE[1]=            uritemplate-4.1.1-py2.py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[py310]=           single
17 SPKGS[py39]=            single
18
19 OPTIONS_AVAILABLE=      PY39 PY310
20 OPTIONS_STANDARD=       none
21 VOPTS[py310]=           PY39=OFF PY310=ON
22 VOPTS[py39]=            PY39=ON PY310=OFF
23
24 DISTNAME=               uritemplate-4.1.1.dist-info
25
26 GENERATED=              yes
27
28 [PY39].USES_ON=                         python:py39,wheel
29
30 [PY310].USES_ON=                        python:py310,wheel
31
32 [FILE:1793:descriptions/desc.single]
33 uritemplate
34 ===========
35
36 Documentation_ -- GitHub_ -- Travis-CI_
37
38 Simple python library to deal with `URI Templates`_. The API looks like
39
40 .. code-block:: python
41
42     from uritemplate import URITemplate, expand
43
44     # NOTE: URI params must be strings not integers
45
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
50
51     # or
52     print(expand(gist_uri, gist_id='123456'))
53
54     # also
55     t.expand({'gist_id': '123456'})
56     print(expand(gist_uri, {'gist_id': '123456'}))
57
58 Where it might be useful to have a class
59
60 .. code-block:: python
61
62     import requests
63
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())
71
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
74 Python, but object creation can consume a great deal of time and so can the
75 re module which uritemplate relies on. Constructing the object once should
76 reduce the amount of time your code takes to run.
77
78 Installing
79 ----------
80
81 ::
82
83     pip install uritemplate
84
85 License
86 -------
87
88 Modified BSD license_
89
90 .. _Documentation: https://uritemplate.readthedocs.io/
91 .. _GitHub: https://github.com/python-hyper/uritemplate
92 .. _Travis-CI: https://travis-ci.org/python-hyper/uritemplate
93 .. _URI Templates: https://tools.ietf.org/html/rfc6570
94 .. _license:
95 https://github.com/python-hyper/uritemplate/blob/master/LICENSE
96
97
98 [FILE:117:distinfo]
99 830c08b8d99bdd312ea4ead05994a38e8936266f84b9a7878232db50b044e02e        10356 uritemplate-4.1.1-py2.py3-none-any.whl
100