Convert your image url from web or your image field from database to base64
Project description
=== CONVERT IMAGE TO BASE64
IMGTOBASE64 convert your image url from web or your image field from database to base64
Detailed documentation is in the "docs" directory.
Quick start
-
Install the module:
pip install imgtobase64
-
CASE OF IMAGE FROM WEB URL
import imgtobase64
web_url = "https://sb.kaleidousercontent.com/67418/800x533/a5ddfb21a6/persons3-nobg.png"
image_base4 = imgtobase64(web_url)
-
CASE OF IMAGE FROM FIELD OF A TABLE ON YOUR DB
`We have a table named Banner with attribute name image and description so : So if we want tranform image to base64 to print blog on pdf,we will do this:
import imgtobase64
image_base4 = imgtobase64(banner.image)`
Project details
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
Hashes for imgtobase64-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f13d0ab93aa620c8880751674f887d1200820e90fbbe9fe7b03c16d913dcb407 |
|
MD5 | bdb0982e730c9fdf9a8a3c94fbffead6 |
|
BLAKE2b-256 | 6b726822b9642cee8107db4416f83c9406aabc538f5f1b77541f7e4d9bcac7b0 |