Metadata-Version: 2.1
Name: data2latex
Version: 1.0.1
Summary: Package prototype for simple generation of LaTeX tables and plots from scientific data for use in any document.
Author-email: Richard Kokštein <richard.Kokstein@fs.cvut.cz>
License: MIT License
        
        Copyright (c) 2023 Richard Kokstein
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/Trolobezka/data2latex
Project-URL: Repository, https://github.com/Trolobezka/data2latex
Project-URL: Documentation, https://trolobezka.github.io/data2latex-docs
Project-URL: Bug Tracker, https://github.com/Trolobezka/data2latex/issues
Keywords: generation,latex,table,plot,graph,array,datatable
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: English
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Utilities
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pylatex (>=1.4.1)
Provides-Extra: dev
Requires-Dist: matplotlib (>=3.7.1) ; extra == 'dev'
Requires-Dist: numpy (>=1.24.3) ; extra == 'dev'
Requires-Dist: pandas (>=2.0.1) ; extra == 'dev'
Requires-Dist: black (>=22.10.0) ; extra == 'dev'
Requires-Dist: sphinx (>=6.2.1) ; extra == 'dev'
Requires-Dist: sphinx-rtd-theme (>=1.2.0) ; extra == 'dev'
Requires-Dist: build (>=0.10.0) ; extra == 'dev'
Requires-Dist: twine (>=4.0.2) ; extra == 'dev'
Requires-Dist: pytest (>=7.3.1) ; extra == 'dev'

# Data2LaTeX

![Data2LaTeX logo](docs/_static/img/logo.png)

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

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](https://github.com/Trolobezka/data2latex).

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](https://github.com/JelteF/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](https://trolobezka.github.io/data2latex-docs).

### Simple features

```python
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

```python
import data2latex as dtol
data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
dtol.table(data)
dtol.finish("simple_table")
```

### Simple plot

```python
import 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

```bash
python -m pip install --upgrade pip
python -m pip install --upgrade data2latex
```

## Development

```bash
python -m venv .venv
./.venv/Scripts/activate
python -m pip install --upgrade pip
python -m pip install .[dev]
```

## Generating documentation

```bash
sphinx-apidoc -o docs src/data2latex
./docs/make html
```

## Packaging

```bash
python clear.py
python -m pip install --upgrade build
python -m build
```

## Publishing

```bash
python -m pip install --upgrade twine
python -m twine upload dist/*
```
