LuPack
Use any Python package directly inside your Lua scripts!
Built on top of LuaWrap.
Installation
pip install LuPack
How to Use
Python packages are injected into your Lua script and available as py_<packagename>.
Quickstart with lua_with()
Pass your package names in, get a runner back, then write Lua as normal:
from LuPack import lua_with
lua_with("math")("""
local result = py_math.sqrt(144)
print("Square root of 144 is: " .. result)
""")
Multiple packages at once
from LuPack import lua_with
lua_with("math", "os")("""
print("Pi is: " .. py_math.pi)
print("Current folder: " .. py_os.getcwd())
""")
Reuse the runner
from LuPack import lua_with
run = lua_with("math")
run("print(py_math.floor(3.9))")
run("print(py_math.sqrt(25))")
Full control with LuPackRuntime
from LuPack import LuPackRuntime
rt = LuPackRuntime()
rt.register("math") # available as py_math in Lua
rt.register("os", "system") # available as py_system in Lua
rt.run("""
print(py_math.pi)
print(py_system.getcwd())
""")
How packages are named in Lua
| Python package | Lua name |
|---|---|
math |
py_math |
os |
py_os |
requests |
py_requests |
os with alias "system" |
py_system |
API
| Tool | What it does |
|---|---|
lua_with("pkg1", "pkg2") |
Returns a runner with those packages injected |
LuPackRuntime() |
Full runtime object for more control |
rt.register("pkg") |
Inject a package into the runtime |
rt.register("pkg", "alias") |
Inject with a custom Lua name |
rt.run("...") |
Run Lua code with all registered packages |
Metadata
Release files for LuPack 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lupack-0.1.0.tar.gz | 2.5 kB | Without provenance | Details for lupack-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lupack-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for lupack-0.1.0-py3-none-any.whl |
Total release size: 5.6 kB
Release files / lupack-0.1.0.tar.gz
| Download URL | lupack-0.1.0.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e50978f4c3c879a4705d7dcadb3aeee4dd7ad9f1498951ad1cbe8ee6b407e8f4
|
|
BLAKE2b-256 checksum How to use checksums |
8336a6110967d8c52babe2e4777b0c64201c0b195c46f11bb8ca1204201cf700
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.3 Windows/11
|
Release files / lupack-0.1.0-py3-none-any.whl
| Download URL | lupack-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f672fc53e9b4cd99cdf5b88edb34426d65d3ce3212bcf24450db737a718c0e8
|
|
BLAKE2b-256 checksum How to use checksums |
82ed8fb0b8b66265d9821f6bbbbb973673966506cf46e6c20268eee9bfe87159
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.3 Windows/11
|
Security for LuPack 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.