Skip to main content

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.

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 Distribution

dataframe_image-0.0.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dataframe_image-0.0.1-py3.7.egg (15.4 kB view details)

Uploaded Egg

dataframe_image-0.0.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file dataframe_image-0.0.1.tar.gz.

File metadata

  • Download URL: dataframe_image-0.0.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • 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.1.tar.gz
Algorithm Hash digest
SHA256 d068725cb8243850863c94ba56fdb50797f6cffb91b7fbd0b751ca193095ef7d
MD5 5eaa768ab3f149db0ca4a9d12816e926
BLAKE2b-256 d0dcf27219fea5a6173efa77b80d745ebdffb46eb13030fa3612255b924ad3f9

See more details on using hashes here.

File details

Details for the file dataframe_image-0.0.1-py3.7.egg.

File metadata

  • Download URL: dataframe_image-0.0.1-py3.7.egg
  • Upload date:
  • Size: 15.4 kB
  • Tags: Egg
  • 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.1-py3.7.egg
Algorithm Hash digest
SHA256 c53ee00f3d1ece808a72bfa178ece067bf71ca1089235bbdcdbeb82a42479212
MD5 2826f0908f21d8fcb3ca763b7c4c3d9b
BLAKE2b-256 c357196bddccbdd3df1ddb6177478ec59d0d6f1e855dafd8ecf306358a59fc30

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dataframe_image-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9743e3c89f459234943069b8ac7d36181271523f936494d375f75e83db2e6167
MD5 7b68cf68162760fa5037422a947e4eb6
BLAKE2b-256 336c1d3190fed788270cb1713b4cde76d85842f1304cc9c702be8a86b90ed5fb

See more details on using hashes here.

Supported by

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