semvec/pypi-packages huggingface dataset:
mesita 0.0.1
Prints tables in terminal
License: MIT
Requires Python: >=3.7

# mesita

mesita is a library for printing tables in the terminal.

You can use it to print a table and customize the cells with different font styles and colors.

mesita is also good for diffing two tables and comparing differences.  You can print tables side-by-side or even mix two tables into one.

mesita is leveraged by unit testing libraries like chispa and beavis.

## Format strings in the Terminal

Here's how to print a string that's bold and blue in the Terminal:

```python
mesita.format_string("Adelaide", ["bold", "blue"])
```

## Print table comparisons

Suppose you have the following tables that are similar.  Here is the first table:

```
+-----------+------+------------+-----------------+
| City name | Area | Population | Annual Rainfall |
+-----------+------+------------+-----------------+
|  Adelaide | 1295 |  1158259   |      600.5      |
|  Brisbane | 5905 |  1857594   |      1146.4     |
+-----------+------+------------+-----------------+
```

Here is the other table:

```
+-----------+------+------------+-----------------+
| City name | Area | Population | Annual Rainfall |
+-----------+------+------------+-----------------+
|  Adelaide | 1300 |  1158259   |      600.5      |
|  Brisbane | 5905 |  1857594   |       1148      |
+-----------+------+------------+-----------------+
```

**Tables as two columns**

Here's how to print the tables as two columns:

```
field_names1 = ["City name", "Area", "Population", "Annual Rainfall"]
rows1 = [
    ["Adelaide", 1295, 1158259, 600.5],
    ["Brisbane", 5905, 1857594, 1146.4]
]
rows2 = [
    ["Adelaide", 1300, 1158259, 600.5],
    ["Brisbane", 5905, 1857594, 1148]
]
m = Mesita(field_names1, rows1, rows2, ["nc"], ["red", "bold"], lambda x, y: x == y)
print("\n" + m.as_columns())
```

![two_columns](https://github.com/MrPowers/mesita/blob/main/images/two_columns.png)

**Tables side-by-side**

Here's how to print the tables side-by-side:

```python
m = Mesita(field_names1, rows1, rows2, ["nc"], ["red", "bold"], lambda x, y: x == y)
print("\n" + m.side_by_side())
```

![side_by_side](https://github.com/MrPowers/mesita/blob/main/images/side_by_side.png)

**Tables combined into one**

And here's how to print the tables combined into a single table:

```python
m = Mesita(field_names, rows1, rows2, ["nc"], ["red", "bold"], lambda x, y: x == y)
print("\n" + m.smush())
```

![smush](https://github.com/MrPowers/mesita/blob/main/images/smush.png)
pyo3-option-pricing 0.1.0
Option pricing library
License: MIT
Requires Python: >=3.10
Keywords: option pricing,rust

# Option Pricing

## Overview

Python [PyO3](https://pyo3.rs/) wrapper package over Rust crate [option-pricing](https://crates.io/crates/option-pricing).  

3 builds:

+ native i.e. current platform
+ to [manylinux](https://github.com/pypa/manylinux)
+ to Windows with [cross](https://github.com/cross-rs/cross).  

## Build

Commands:

```sh
# prerequisite
mm activate work
pip install build

# dev install
pip install -e .

# watch 
cargo watch --watch rust -- pip install -e .

# test
pytest

# install
pip install .

# ------- build native wheel
unset CARGO
unset CARGO_BUILD_TARGET
unset PYO3_CROSS_LIB_DIR
unset PYO3_CROSS_PYTHON_VERSION
unset DIST_EXTRA_CONFIG

python -m build .

# ------- build manylinux wheel
# image used by build
docker build -t builder-manylinux:local -f ./Dockerfile.manylinux .

# build wheels for several python versions
docker run --rm -v $(pwd):/io builder-manylinux:local /bin/bash /io/build-manylinux-wheels.sh

# ------- build windows wheel - using cross
# prerequisite
cargo install cross

export CARGO=cross
export CARGO_BUILD_TARGET=x86_64-pc-windows-gnu
export DIST_EXTRA_CONFIG=/tmp/build-opts.cfg

# set wheel suffix
echo -e "[bdist_wheel]\nplat_name=win-amd64" > $DIST_EXTRA_CONFIG

# image used by cross
docker build -t cross-pyo3:x86_64-pc-windows-gnu -f ./Dockerfile.win .

# build windows wheel
python -m build .
```

This produced wheels for linux and windows:

```sh
ls -1  dist
pyo3_option_pricing-0.1.0-cp310-cp310-linux_x86_64.whl
pyo3_option_pricing-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyo3_option_pricing-0.1.0-cp310-cp310-win_amd64.whl
pyo3_option_pricing-0.1.0-cp311-cp311-linux_x86_64.whl
pyo3_option_pricing-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyo3_option_pricing-0.1.0.tar.gz
```

## Publish

Commands:

```sh
# prerequisite
mm activate work
pip install -U twine

twine check dist/*

# assuming .pypirc configured
# for linux only manylinux: the others will be refused
twine upload dist/*.tar.gz
twine upload dist/*manylinux*
twine upload dist/*win_amd64*
```

## Install

Commands:

```sh
pip install pyo3_option_pricing
```

## Ref

Packaging offical recommendation: [Is setup.py deprecated?](https://packaging.python.org/en/latest/discussions/setup-py-deprecated/).