Skip to main content

Import Lua modules directly from within Python

Project description


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.



return {
    say_hello = function(person)
        print("Hello, " .. person)

import foo



lua_importer may be registered within Python code:

from lua_imports import lua_importer


(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:

import lua_imports; lua_imports.lua_importer.register()


This module wraps Lupa, and so comes with all the same caveats about Lua vs. Python data types.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lua-imports, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size lua_imports-1.0.0-py3-none-any.whl (3.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size lua_imports-1.0.0.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page