Metadata-Version: 2.4
Name: sos-lua
Version: 0.1.0
Summary: SoS Notebook extension for Lua
Author-email: Bo Peng <Bo.Peng@bcm.edu>
Maintainer-email: Bo Peng <Bo.Peng@bcm.edu>
License: 3-clause BSD
Project-URL: Homepage, https://github.com/vatlab/SOS
Project-URL: Repository, https://github.com/vatlab/sos-lua
Project-URL: Bug Tracker, https://github.com/vatlab/sos-lua/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: setuptools<81
Requires-Dist: sos>=0.19.0
Requires-Dist: sos-notebook>=0.24.0

# sos-lua

SoS Notebook extension for the [Lua](https://www.lua.org/) programming language.

## Installation

```bash
pip install sos-lua
```

You will also need a Lua Jupyter kernel installed. This module supports:

- [ILua](https://github.com/guysv/ilua) (`pip install ilua`) - kernel name `lua`
- [xeus-lua](https://github.com/jupyter-xeus/xeus-lua) (`conda install -c conda-forge xeus-lua`) - kernel name `xlua`

## Data Exchange

This module supports exchanging the following data types between SoS (Python) and Lua:

| Python | Lua |
|--------|-----|
| `None` | `nil` |
| `bool` | `boolean` |
| `int`, `float` | `number` |
| `str` | `string` |
| `list`, `tuple` | sequential table `{1, 2, 3}` |
| `dict` | keyed table `{a=1, b=2}` |
| `set` | sequential table |
| `numpy.ndarray` | nested table |
| `pandas.DataFrame` | table of column tables |

Nested structures (tables within tables) are supported in both directions.

## Usage

In a SoS notebook, use Lua cells and exchange variables with `%get` and `%put`:

```
# In a SoS cell
data = [1, 2, 3]

# In a Lua cell
%get data
print(data[1])  -- prints 1

# Transfer back
result = {sum = 6, count = 3}
%put result
```
