Skip to content

vatlab/sos-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sos-lua

SoS Notebook extension for the Lua programming language.

Installation

pip install sos-lua

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

  • ILua (pip install ilua) - kernel name lua
  • 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

About

SoS Notebook extension for Lua

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages