livia-python 1.10.1__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- livia/Livia.dll +0 -0
- livia/Native/ScreenCapture/Livia.Native.DxgiFrameCapture.dll +0 -0
- livia/__init__.py +44 -0
- livia/_version.py +1 -0
- livia/runtimeconfig.json +15 -0
- livia_python-1.10.1.dist-info/METADATA +56 -0
- livia_python-1.10.1.dist-info/RECORD +9 -0
- livia_python-1.10.1.dist-info/WHEEL +5 -0
- livia_python-1.10.1.dist-info/top_level.txt +1 -0
livia/Livia.dll
ADDED
|
Binary file
|
|
Binary file
|
livia/__init__.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import importlib
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from ._version import __version__
|
|
4
|
+
|
|
5
|
+
from pythonnet import load
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
_PACKAGE_DIRECTORY = Path(__file__).resolve().parent
|
|
9
|
+
_ASSEMBLY_PATH = _PACKAGE_DIRECTORY / "Livia.dll"
|
|
10
|
+
_RUNTIME_CONFIG_PATH = _PACKAGE_DIRECTORY / "runtimeconfig.json"
|
|
11
|
+
|
|
12
|
+
if not _ASSEMBLY_PATH.exists():
|
|
13
|
+
raise FileNotFoundError(
|
|
14
|
+
f"Could not find Livia.dll at {_ASSEMBLY_PATH}"
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
if not _RUNTIME_CONFIG_PATH.exists():
|
|
18
|
+
raise FileNotFoundError(
|
|
19
|
+
f"Could not find runtimeconfig.json at {_RUNTIME_CONFIG_PATH}"
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
load(
|
|
23
|
+
"coreclr",
|
|
24
|
+
runtime_config=str(_RUNTIME_CONFIG_PATH),
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
import clr
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
_assembly = clr.AddReference(str(_ASSEMBLY_PATH))
|
|
31
|
+
|
|
32
|
+
for type_ in _assembly.GetTypes():
|
|
33
|
+
if not type_.IsPublic or type_.IsNested:
|
|
34
|
+
continue
|
|
35
|
+
|
|
36
|
+
namespace = type_.Namespace
|
|
37
|
+
|
|
38
|
+
if namespace is None:
|
|
39
|
+
continue
|
|
40
|
+
|
|
41
|
+
module = importlib.import_module(namespace)
|
|
42
|
+
|
|
43
|
+
if hasattr(module, type_.Name):
|
|
44
|
+
globals()[type_.Name] = getattr(module, type_.Name)
|
livia/_version.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.10.1"
|
livia/runtimeconfig.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: livia-python
|
|
3
|
+
Version: 1.10.1
|
|
4
|
+
Summary: Python bindings for the Livia .NET library
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: pythonnet<4,>=3.0
|
|
8
|
+
|
|
9
|
+
# Livia for Python
|
|
10
|
+
|
|
11
|
+
**A New Frontier in Macro Development**
|
|
12
|
+
|
|
13
|
+
Official Python bindings for the [Livia](https://github.com/AlinaWan/Livia) .NET library, an open-source C# automation library for building Roblox macros and applications.
|
|
14
|
+
|
|
15
|
+
*"Magnus ab integro saeclorum nascitur ordo" —Virgil, Eclogue IV (c. 40 BCE)*
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
- Python 3.11 or later
|
|
20
|
+
- [.NET 10 Desktop Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/10.0)
|
|
21
|
+
- Windows 11 x86-64
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
Livia can be added to an existing Python project by adding the package:
|
|
26
|
+
```powershell
|
|
27
|
+
pip install livia-python # -> import livia
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## API Usage
|
|
31
|
+
|
|
32
|
+
The public Livia APIs are exposed directly through the `livia` package.
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
import livia
|
|
36
|
+
|
|
37
|
+
print(livia.WindowUtils)
|
|
38
|
+
````
|
|
39
|
+
|
|
40
|
+
Livia APIs that accept .NET-specific types require the corresponding Python.NET type.
|
|
41
|
+
For example, `WindowUtils.ForceFocusWindow` accepts a `System.IntPtr` because an
|
|
42
|
+
HWND is represented by `IntPtr` in the .NET API.
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
import livia
|
|
46
|
+
|
|
47
|
+
from System import IntPtr
|
|
48
|
+
|
|
49
|
+
hwnd = IntPtr(12345678)
|
|
50
|
+
|
|
51
|
+
if livia.WindowUtils.ForceFocusWindow(hwnd):
|
|
52
|
+
print("Window focused")
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The Python package uses [Python.NET](https://pythonnet.github.io/) to expose the
|
|
56
|
+
underlying .NET APIs.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
livia/Livia.dll,sha256=17Et7-NZJfO0zhShfjZjejvEFOaNzdrVY2VSZKZlIq4,73728
|
|
2
|
+
livia/__init__.py,sha256=OW5AkqVzCUieQ6pXCZSIY55B1pqQdIvBP652ExpRLa4,1040
|
|
3
|
+
livia/_version.py,sha256=H141LOGpyHaw09S-pFLtKR4fE2L2Y8QwKlwu84ukusA,24
|
|
4
|
+
livia/runtimeconfig.json,sha256=nNQYW-KPFHH2o_R6wj-P3hF6jL8WOPAGAHzQBwClS54,271
|
|
5
|
+
livia/Native/ScreenCapture/Livia.Native.DxgiFrameCapture.dll,sha256=px09mjQWf8Ej0eIBF4cDMTdY6mwiTisIlSxJUsXExOg,15360
|
|
6
|
+
livia_python-1.10.1.dist-info/METADATA,sha256=hGXjYQhd63W1NbOb2irtFPLo9tpWIOARfb9BEEPZB9U,1491
|
|
7
|
+
livia_python-1.10.1.dist-info/WHEEL,sha256=3I5VVWZdsFlU417aCS2bMRuerS8wsfvBq99MyatBV3A,97
|
|
8
|
+
livia_python-1.10.1.dist-info/top_level.txt,sha256=tssDmWRU976yueFVm6ctkHGAaNEAICOb7MGc5XW5co8,6
|
|
9
|
+
livia_python-1.10.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
livia
|