uritemplate 4.2.0
pip install uritemplate
Released:
Implementation of RFC 6570 URI Templates
Navigation
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
π Avatar for brettcannon from gravatar.combrettcannon π Avatar for graffatcolmingov from gravatar.com
graffatcolmingov π Avatar for jcgregorio from gravatar.com
jcgregorio π Avatar for mnot from gravatar.com
mnot
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: BSD 3-Clause OR Apache-2.0
- Author: Ian Stapleton Cordasco
- Tags rfc , 6570 , uri , template
- Requires: Python >=3.9
Classifiers
- Development Status
- Intended Audience
- Programming Language
Project description
Documentation β GitHub β Travis-CI
Simple python library to deal with URI Templates. The API looks like
fromuritemplateimport URITemplate, expand# NOTE: URI params must be strings not integersgist_uri = 'https://api.github.com/users/sigmavirus24/gists{/gist_id}'t = URITemplate(gist_uri)print(t.expand(gist_id='123456'))# => https://api.github.com/users/sigmavirus24/gists/123456# orprint(expand(gist_uri, gist_id='123456'))# alsot.expand({'gist_id': '123456'})print(expand(gist_uri, {'gist_id': '123456'}))
Where it might be useful to have a class
importrequestsclassGitHubUser(object): url = URITemplate('https://api.github.com/user{/login}') def__init__(self, name): self.api_url = url.expand(login=name) response = requests.get(self.api_url) if response.status_code == 200: self.__dict__.update(response.json())
When the module containing this class is loaded, GitHubUser.url is evaluated and so the template is created once. Itβs often hard to notice in Python, but object creation can consume a great deal of time and so can the re module which uritemplate relies on. Constructing the object once should reduce the amount of time your code takes to run.
Installing
pip install uritemplate
License
Modified BSD license
Project details
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
π Avatar for brettcannon from gravatar.combrettcannon π Avatar for graffatcolmingov from gravatar.com
graffatcolmingov π Avatar for jcgregorio from gravatar.com
jcgregorio π Avatar for mnot from gravatar.com
mnot
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: BSD 3-Clause OR Apache-2.0
- Author: Ian Stapleton Cordasco
- Tags rfc , 6570 , uri , template
- Requires: Python >=3.9
Classifiers
- Development Status
- Intended Audience
- Programming Language
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uritemplate-4.2.0.tar.gz.
File metadata
- Download URL: uritemplate-4.2.0.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
480c2ed180878955863323eea31b0ede668795de182617fef9c6ca09e6ec9d0e
|
|
| MD5 |
c1b679033e9be398232e75ad9e09e8e8
|
|
| BLAKE2b-256 |
9860f174043244c5306c9988380d2cb10009f91563fc4b31293d27e17201af56
|
Provenance
The following attestation bundles were made for uritemplate-4.2.0.tar.gz:
Publisher:
release.yml on python-hyper/uritemplate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uritemplate-4.2.0.tar.gz -
Subject digest:
480c2ed180878955863323eea31b0ede668795de182617fef9c6ca09e6ec9d0e - Sigstore transparency entry: 227293398
- Sigstore integration time:
-
Permalink:
python-hyper/uritemplate@e89ada10dd4e9deb8c576f3f0de8a813fbea9c02 -
Branch / Tag:
refs/tags/4.2.0 - Owner: https://github.com/python-hyper
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e89ada10dd4e9deb8c576f3f0de8a813fbea9c02 -
Trigger Event:
push
-
Statement type:
File details
Details for the file uritemplate-4.2.0-py3-none-any.whl.
File metadata
- Download URL: uritemplate-4.2.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
962201ba1c4edcab02e60f9a0d3821e82dfc5d2d6662a21abd533879bdb8a686
|
|
| MD5 |
9de1bba5e7bffd8c77388ae3b62fee87
|
|
| BLAKE2b-256 |
a9993ae339466c9183ea5b8ae87b34c0b897eda475d2aec2307cae60e5cd4f29
|
Provenance
The following attestation bundles were made for uritemplate-4.2.0-py3-none-any.whl:
Publisher:
release.yml on python-hyper/uritemplate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uritemplate-4.2.0-py3-none-any.whl -
Subject digest:
962201ba1c4edcab02e60f9a0d3821e82dfc5d2d6662a21abd533879bdb8a686 - Sigstore transparency entry: 227293409
- Sigstore integration time:
-
Permalink:
python-hyper/uritemplate@e89ada10dd4e9deb8c576f3f0de8a813fbea9c02 -
Branch / Tag:
refs/tags/4.2.0 - Owner: https://github.com/python-hyper
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e89ada10dd4e9deb8c576f3f0de8a813fbea9c02 -
Trigger Event:
push
-
Statement type:
