This Python module contains only one function: extract.
It extracts links and their relations from a Link Header Field [1] and returns a dict where the keys are the relations and the values are the links themselves.
Installation
pip install links-from-link-header
Usage
>>> import links_from_header
>>> header = '<https://api.github.com/user/repos?page=1>; rel="first", <https://api.github.com/user/repos?page=9>; rel="prev", <https://api.github.com/user/repos?page=11>; rel="next", <https://api.github.com/user/repos?page=50>; rel="last"'
>>> links_from_header.extract(header)
{
'first': 'https://api.github.com/user/repos?page=1',
'prev': 'https://api.github.com/user/repos?page=9',
'next': 'https://api.github.com/user/repos?page=11',
'last': 'https://api.github.com/user/repos?page=50',
}
Release files for links-from-link-header 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| links-from-link-header-0.1.0.tar.gz | 1.6 kB | Details |
Release files / links-from-link-header-0.1.0.tar.gz
| Download URL | links-from-link-header-0.1.0.tar.gz |
|---|---|
| Size | 1.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0c1b5a34cee90dee55fa77c016d12144b116525527c790243d196281db9a25b
|
|
BLAKE2b-256 checksum How to use checksums |
f1824a877f68045d7e503e60d021da6fefb18bd3be973ba44ff7edec4dc778ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |