rest-api-supporter
https://pypi.org/project/rest-api-supporter/
pip install rest-api-supporter
Supported APIs
base64_encode
from PIL import Image
from rest_api_supporter.utils.base64_encode_image import base64_encode_image
image = Image.open("rock.jpg")
base64_encoded = base64_encode_image(image)
print(base64_encoded) #data:image/png;base64,/9j/4AAQSkZJRgABAQ...2qjR37P/2Q==
import datasets
from rest_api_supporter.utils.base64_encode_audio import base64_encode_audio
path = 'up.wav'
dataset = datasets.Dataset.from_dict({"audio": [path]})
dataset = dataset.cast_column("audio", datasets.Audio(sampling_rate=16_000)) #https://huggingface.co/blog/audio-datasets#1-resampling-the-audio-data
array = dataset[0]["audio"]["array"] #numpy array
#sampling_rate = dataset[0]["audio"]["sampling_rate"] #Wav2Vec2FeatureExtractor was trained using a sampling rate of 16000. Please make sure that the provided `raw_speech` input was sampled with 16000 and not 8000.
sampling_rate = 16000
base64_encoded = base64_encode_audio(array)
print(base64_encoded) #data:audio/wav;base64,UklGRiTuAgBXQVZFZm...At84WACNZGwA=
from rest_api_supporter.utils.base64_encode_video import base64_encode_video
file = "video.mp4"
with open(file, "rb") as f:
bytes_value = f.read() #bytes
base64_encoded = base64_encode_video(bytes_value)
print(base64_encoded) #data:video/mp4;base64,/9j/4AAQSkZJRgABAQ...2qjR37P/2Q==
base64_decode
from rest_api_supporter.utils.base64_decode_image import base64_decode_image
base64_encoded = "data:image/png;base64,/9j/4AAQSkZJRgABAQ...2qjR37P/2Q=="
#base64_encoded = "/9j/4AAQSkZJRgABAQ...2qjR37P/2Q==
base64_decoded = base64_decode_image(base64_encoded)
print(type(base64_decoded)) #<class 'PIL.JpegImagePlugin.JpegImageFile'>
from rest_api_supporter.utils.base64_decode_audio import base64_decode_audio
base64_encoded = "data:audio/wav;base64,UklGRiTuAgBXQVZFZm...At84WACNZGwA="
#base64_encoded = "/9j/4AAQSkZJRgABAQ...2qjR37P/2Q=="
base64_decoded = base64_decode_audio(base64_encoded)
print(type(base64_decoded)) # #넘파이
from rest_api_supporter.utils.base64_decode_video import base64_decode_video
base64_encoded = "data:video/mp4;base64,/9j/4AAQSkZJRgABAQ...2qjR37P/2Q=="
#base64_encoded = "/9j/4AAQSkZJRgABAQ...2qjR37P/2Q=="
base64_decoded = base64_decode_video(base64_encoded)
print(type(base64_decoded)) # #넘파이
Metadata
Release files for rest-api-supporter 0.0.33
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 | |
|---|---|---|---|---|
| rest-api-supporter-0.0.33.tar.gz | 3.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rest_api_supporter-0.0.33-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.0 kB
Release files / rest-api-supporter-0.0.33.tar.gz
| Download URL | rest-api-supporter-0.0.33.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e5b5c5d23110d23bac813af294a84205465bd95d4a31f68f316a5b68d82cbbf
|
|
BLAKE2b-256 checksum How to use checksums |
7e9be96da6e1d7ee0dca025742de82c0faaae474da2dd66e5485d75063dcee87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Release files / rest_api_supporter-0.0.33-py3-none-any.whl
| Download URL | rest_api_supporter-0.0.33-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d1f19ab56cdc7bf10f64779a39564128f2f7faa7cc1cfe2c4d30d39df5abe90
|
|
BLAKE2b-256 checksum How to use checksums |
0047f4327982ca3270c10618e84f72555ac8c4c6d12cca7337b5c001910654b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Security for rest-api-supporter 0.0.33
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.