Skip to main content

Embed pandas DataFrames as images in pdf and markdown files when converting from 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.

png

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.

png

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

dataframe_image-0.0.3-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file dataframe_image-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: dataframe_image-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

File hashes

Hashes for dataframe_image-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4d40528d9f82824a6905fbb3ae06dcac835ab4e300fd92ab375c367e1273efea
MD5 146fdf48f6a6e14fa84e41104f9c4131
BLAKE2b-256 1d4d400d231119cdc657d0ca2f65d536ed7cc26d6378879e98ff167cb92a9749

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page