xhtml2pdfvskiba
xhtml2pdf is a Python library that allows you to convert HTML and CSS documents to PDF files. It is built on top of ReportLab, a powerful PDF generation library for Python.
xhtml2pdf makes it easy to convert HTML and CSS documents to PDF by using ReportLab's powerful layout engine to handle the rendering of the document.
The library supports a wide variety of HTML and CSS features, including tables, lists, images, and links. It also supports several popular CSS frameworks such as Bootstrap and Foundation.
To use xhtml2pdf, you first need to install it via pip by running `pip install xhtml2pdf``. Once it is installed, you can use the xhtml2pdf.pisa.pisaDocument() function to convert an HTML file to a PDF.
Kiba is a lightweight Ruby gem that provides a simple and powerful way to process and transform data in an ETL (Extract, Transform, Load) pipeline. It allows you to define a set of operations to perform on the data, and then automatically applies those operations to the data, making it easy to extract, transform, and load data from various sources and formats.
Kiba provides a simple and intuitive API for defining the pipeline, and it is built on top of the Enumerator API, which allows for easy manipulation of large datasets with low memory usage.
Example Use
from xhtml2pdf import pisa
with open('input.html', 'r') as html_file:
html = html_file.read()
with open('output.pdf', 'wb') as pdf_file:
pisa.pisaDocument(html, pdf_file)
require 'kiba'
data = [{ name: 'Alice', age: 25 }, { name: 'Bob', age: 30 }]
Kiba.parse do
source Kiba::Common::EnumerableSource, data
transform { |row| row[:age] += 1 }
destination Kiba::Common::EnumerableDestination
end.run
# Output: [{ name: 'Alice', age: 26 }, { name: 'Bob', age: 31 }]