Package prototype for simple generation of LaTeX tables and plots from scientific data for use in any document.
Project description
Data2LaTeX
This project is part of my bachelor thesis which deals with data representation using Python and LaTeX. You can find the source code on my GitHub.
The idea behind this package prototype is that generating LaTeX documents containing scientific data from Python should not be difficult and require many steps. Currently the package supports the creation of simple tables and two types of plots: scatter plots and line plots. The package uses the PyLaTeX package to handle the document creation and compilation process. The main data sources are arrays and data tables from the popular numpy
and pandas
packages. A major inspiration for the module syntax is the matplotlib.pyplot
module, which allows plots to be created in a few lines of code. The tables are created using tblr
environment from tabularray
package. The plots are created using tikzpicture
/ axis
environment from tikz
/ pgfplots
package.
Examples
Examples with results can be found in the documentation.
Simple features
import data2latex as dtol
dtol.section("Data2LaTeX")
dtol.text("This project is part of my bachelor thesis which deals with data representation using Python and LaTeX")
dtol.finish("simple_features")
Simple table
import data2latex as dtol
data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
dtol.table(data)
dtol.finish("simple_table")
Simple plot
port data2latex as dtol
X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Y = [84, 13, 94, 37, 80, 89, 90, 45, 55, 26, 92]
dtol.plot(X, Y, line="-", mark="*")
dtol.finish("simple_plot")
Installation
python -m pip install --upgrade pip
python -m pip install --upgrade data2latex
Development
python -m venv .venv
./.venv/Scripts/activate
python -m pip install --upgrade pip
python -m pip install .[dev]
Generating documentation
sphinx-apidoc -o docs src/data2latex
./docs/make html
Packaging
python clear.py
python -m pip install --upgrade build
python -m build
Publishing
python -m pip install --upgrade twine
python -m twine upload dist/*
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
Built Distribution
Hashes for data2latex-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cd933db268a33cc16f343d555aae26040d1c176fb7ecf11ced8bc28001769b0 |
|
MD5 | 42a1b42c0084352a9c70000dc89b7e2d |
|
BLAKE2b-256 | 5fa2c23b8ba3a20f77b4d163c9c1e6b930e86b53c546f4ae92c0920ff15b6bde |