Vadivelu
A Python library for accessing the Vadivelu API.
Installation
Must have Python 3.7 or higher
pip install vadivelu
API Reference
vadivelu.get_available_formats(code)
Get the available formats for a HTTP code. The formats can be gif, jpg, or both.
Parameters
- code: int
The HTTP code to use
Returns
Tuple[str, str] A tuple containing the avaiable formats
Raises
ValueError if the code provided is not supported by the API
pick_available_format(code, priority)
Pick a format (gif or jpg) that the API supports for a specific HTTP code.
Parameters
- code: int
The HTTP code to use
- priority: str
The format to pick in the case both gif and jpg are available, defaults to gif
Returns
str The chosen format (gif or jpg)
Raises
ValueError if the code provided is not supported by the API or if priority is not gif or jpg
get_media_url(code, media_format)
Get the media URL for the specified code in the specified format.
Parameters
- code: int
The HTTP code to use
- media_format: str
The media format to get (gif or jpg)
Returns
str Theurl for the media
Raises
ValueError media_format is not available for the given code, use pick_available_format to avoid this error
Example
import requests
import vadivelu
code = 404
url = vadivelu.get_media_url(code, vadivelu.pick_available_format(code, 'jpg'))
# save jpg to 404.jpg file
with open('404.jpg', 'wb') as f:
f.write(requests.get(url).content)
Metadata
Release files for vadivelu 1.0.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 | Provenance | Actions |
|---|---|---|---|---|
| vadivelu-1.0.0.tar.gz | 3.7 kB | Without provenance | Details for vadivelu-1.0.0.tar.gz |
Release files / vadivelu-1.0.0.tar.gz
| Download URL | vadivelu-1.0.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37312aa403d9815c289b55abd2a642f5573b6e3283d589df9e23c63edc193bbf
|
|
BLAKE2b-256 checksum How to use checksums |
43890fb472930ab087c4ef32f155f773b8eaabc46f3ede013c52088ebced366c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Security for vadivelu 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.