Embed pandas DataFrames as images in pdf and markdown files when converting Jupyter Notebooks
Project description
dataframe_image
A package to convert Jupyter Notebooks to either pdf or markdown documents embedding pandas DataFrames as images instead of their default format.
When converting Jupyter Notebooks to pdf using nbconvert, pandas DataFrames appear as either raw text or as a simple latex table. When converting to markdown The DataFrame's appearance while running a Jupyter Notebook is much different. Below, we have a pdf showing both the plain text and latex DataFrame representation.
This package was created to embed DataFrames into pdf and markdown documents as images so that they appear exactly as they do in a Jupyter Notebook. Here, the same DataFrame as above is show in a pdf converted using dataframe_image.
Installation
pip install dataframe_image
Usage
In a separate Python script, import the dataframe_image
package and pass the file name of your notebook to the convert
function.
>>> import dataframe_image as dfi
>>> dfi.convert('path/to/your_notebook.ipynb',
to='pdf',
max_rows=30,
max_cols=10,
ss_width=1000,
ss_height=900,
resize=1,
chrome_path=None,
limit=None
)
Dependencies
You must have the following python libraries installed
You must also have Google Chrome installed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for dataframe_image-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9743e3c89f459234943069b8ac7d36181271523f936494d375f75e83db2e6167 |
|
MD5 | 7b68cf68162760fa5037422a947e4eb6 |
|
BLAKE2b-256 | 336c1d3190fed788270cb1713b4cde76d85842f1304cc9c702be8a86b90ed5fb |