Skip to main content

Convert tables from pandas to latex or markdown format.

Project description

About

The module pyscholar consists of functions to convert tables imported in pandas to latex or markdown format. It aso includes a function replace_include to replace the content of the file mentioned after !include.

Installation

pip install pyscholar

Usage

pyscholar is easy to use. Just import:

from pyscholar import pandoc

For table conversion

Instantiate the Table class using:

tab = pandoc.Table(df)

Convert table to markdown and save as:

tab.to_markdown('table.md')

Convert table to latex and save as:

tab.to_latex('table.tex')

Replacing content of a file

To replace content of a file mentioned after !include, use replace_include function in pandoc.

Example:

If the file infilename contains the following line:

!include table.md

Then, using replace_include will replace that line with contents of file table.md.

from pandoc import replace_include

replace_include(infilename, outfilename)

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

pyscholar-0.1.tar.gz (1.5 kB view hashes)

Uploaded Source

Built Distribution

pyscholar-0.1-py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 3

Supported by

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