Metadata-Version: 2.1
Name: lua-imports
Version: 1.0.0
Summary: Import Lua modules directly from within Python
Home-page: https://github.com/madman-bob/python-lua-imports
Author: Robert Wright
Author-email: madman.bob@hotmail.co.uk
License: MIT
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: more-properties
Requires-Dist: custom-imports
Requires-Dist: lupa
Requires-Dist: twine

# lua_imports

Import Lua modules directly from within Python.

## Basic Usage

Once `lua_imports.lua_importer` has been registered, write an `import` statement in your Python code, referring to your Lua module.

### Example

`foo.lua`

```lua
return {
    say_hello = function(person)
        print("Hello, " .. person)
    end
}
```

`bar.py`

```python
import foo

foo.say_hello("World")
```

## Registration

`lua_importer` may be registered within Python code:

```python
from lua_imports import lua_importer

lua_importer.register()
```

(Note that this must come *before* any Lua imports)

Alternatively, to register `lua_importer` environment-wide, create a `lua-imports.pth` file in your environment's `site-packages` folder with the following contents:

```pth
import lua_imports; lua_imports.lua_importer.register()
```

## Caveats

This module wraps [Lupa](https://github.com/scoder/lupa), and so comes with all the same caveats about Lua vs. Python data types.

