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
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 Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | d402c16109598cb61fb005d00748e94b96bb59941beaff9e1dcd55f22c28db71 |
|
MD5 | 5bf21a29115b2ef01bc0843b5dfaba1c |
|
BLAKE2b-256 | 045476d9ce80d7421d168f23a40158255425fd679174cb4ed174328fd8dacc36 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9339ecdae4d22a05afcba7a2d028d583fac69fa59b1c14ee0e6ad3dffbc370da |
|
MD5 | f4a4af0a0c5107d4332a0b16be0c879a |
|
BLAKE2b-256 | c3aa88cd64297fcf76d3e3a6ca56f267eb8338df88e41a083396e5dcbe4cff60 |