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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pyscholar-0.1.tar.gz.

File metadata

  • Download URL: pyscholar-0.1.tar.gz
  • Upload date:
  • Size: 1.5 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.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for pyscholar-0.1.tar.gz
Algorithm Hash digest
SHA256 d402c16109598cb61fb005d00748e94b96bb59941beaff9e1dcd55f22c28db71
MD5 5bf21a29115b2ef01bc0843b5dfaba1c
BLAKE2b-256 045476d9ce80d7421d168f23a40158255425fd679174cb4ed174328fd8dacc36

See more details on using hashes here.

File details

Details for the file pyscholar-0.1-py3-none-any.whl.

File metadata

  • Download URL: pyscholar-0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.4 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.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for pyscholar-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9339ecdae4d22a05afcba7a2d028d583fac69fa59b1c14ee0e6ad3dffbc370da
MD5 f4a4af0a0c5107d4332a0b16be0c879a
BLAKE2b-256 c3aa88cd64297fcf76d3e3a6ca56f267eb8338df88e41a083396e5dcbe4cff60

See more details on using hashes here.

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