pyhtmlconv: html converter (image / pdf)
Project description
pyhtmlconv: html converter (image / pdf)
python html converter (image / pdf)
Installation
Anda perlu menginstall wkhtmltopdf, sebelum menginstall modul ini.
pip install pyhtmlconv
Example
import pyhtmlconv as html
url = "https://google.com"
image = html.convert_to_image(url, "jpeg")
with open("test_image.jpeg", "wb") as fp:
fp.write(image)
pdf = html.convert_to_pdf(url)
with open("test_file.pdf") as fp:
fp.write(pdf)
Anda juga dapat mengkonversikan data (image atau pdf) ke bentuk data uri dengan cara menambahkan nilai True pada parameter datauri di fungsi convert_to_image atau convert_to_pdf.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyhtmlconv-1.2.tar.gz.
File metadata
- Download URL: pyhtmlconv-1.2.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18cbe32d26285d2d0d790fe7a3aeb1c1550ae83ed917e7ba5ceedbc2d7fc7b35
|
|
| MD5 |
0507b3574bd026b215afd4fad22bf3ca
|
|
| BLAKE2b-256 |
34db638eeb13c5a5738e3d76d707ed89277ff41c39c2e5a735e62f5975bf294f
|
File details
Details for the file pyhtmlconv-1.2-py2.py3-none-any.whl.
File metadata
- Download URL: pyhtmlconv-1.2-py2.py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aed1c7598e9d705e09eba41762a32191863c1f743ef86aa0afb0063904bd8af
|
|
| MD5 |
74e173af11276d20b06fa7938ca290fe
|
|
| BLAKE2b-256 |
ce9ec78ddcac44925a779fb95bfd12241082e6e95abe572dbbf9cfca53c08aea
|