Demo project
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
imgtobase64-0.0.1.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for imgtobase64-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cfd96f2d63467f8ada40e730eca070173e312e6d355d88f8480033d11441f76 |
|
MD5 | 6aada462d1f710835ecef212a6b5eb15 |
|
BLAKE2b-256 | 4ba4bffd9246594033e272204dc3da4e2d9310b20ada86b3dfe0341afd80f5d3 |