Skip to main content

pytextable - create latex tables using pure python

CI Codecov Code style: black

pytextable creates well-formatted latex tables with booktabs support in pure python.

pytextable is highly-configurable, you decide how your table should look.

pytextable is small, fast and requires nothing but python>=3.6.

Quick Start Guide

  1. Install

    pip install pytextable
  2. Import

    import pytextable
  3. Create a latex table from your data :)

    pytextable.write(data, "table.tex")

Example

import pytextable

# This is usually your 2d numpy array or any sequence of sequences
DATA = [[1.2346, 1, 1.2346], [1.2346, 1.2346, 1.2346], [1.2346, 1.2346, 1.2346]]

>>> pytextable.tostring(
    DATA,
    fmt=".3f",
    header=("first", "second", "third"),
    caption="My fancy pytextable",
    label="tab:pytextable",
)
r"""
\begin{table}
    \centering
    \caption{My fancy pytextable}
    \label{tab:pytextable}
    \begin{tabular}{ccc}
        \toprule
        first & second & third \\
        \midrule
        1.235 & 1.000 & 1.235 \\
        1.235 & 1.235 & 1.235 \\
        1.235 & 1.235 & 1.235 \\
        \bottomrule
    \end{tabular}
\end{table}
"""

# To write to file use pytextable.write(DATA, filename)
>>> pytextable.write(DATA, "table.tex", fmt=".3f", ...)

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Metadata

Release files for pytextable 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytextable 0.2.1
File Size Uploaded Provenance Actions
pytextable-0.2.1.tar.gz 20.1 kB Without provenance Details for pytextable-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytextable 0.2.1
File Interpreter ABI Platform Actions
pytextable-0.2.1-py3-none-any.whl Python 3 none any Details for pytextable-0.2.1-py3-none-any.whl

Total release size: 38.6 kB

Release files / pytextable-0.2.1.tar.gz

Download URL pytextable-0.2.1.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c93cf66bab3b10f5bc2b1b30f6bbd5dd5d51d024cee00e64ec7efdb5e1367b35
BLAKE2b-256 checksum
How to use checksums
ee3014adb3bfab29e7cbd8c0bbc9d2879c3ed9f065e9256fd2559f39e666c58d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

Release files / pytextable-0.2.1-py3-none-any.whl

Download URL pytextable-0.2.1-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a51d0c627f3a502e67e734785d8d35bbbcadf49db16e80fe2e05ebe48bee5278
BLAKE2b-256 checksum
How to use checksums
67f6a8c2aaa172e3af24331ba5a0b358e4eb70788b9d72629465e7771705df1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

Security for pytextable 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page