Files
libloot-python/README.md
T

41 lines
1.9 KiB
Markdown
Raw Normal View History

2016-08-07 21:23:23 +01:00
LOOT API Python Module
=======================
2016-08-13 15:00:01 +01:00
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/loot/loot-api-python?branch=master&svg=true)](https://ci.appveyor.com/project/WrinklyNinja/loot-api-python)
2016-08-07 21:23:23 +01:00
A Python module that wraps the LOOT API, generated by [pybind11](https://github.com/pybind/pybind11).
2016-08-13 15:00:01 +01:00
The module is at a very early stage of development and wraps an API that is itself still a work-in-progress.
## Downloads
Snapshot builds are available on [Bintray](https://bintray.com/wrinklyninja/loot/loot-api-python). The snapshot build archives are named like so:
```
loot_api_python-<short revision ID>-win32.7z
```
For example `loot_api_python-94de368-win32.7z` was built using the revision with shortened commit ID `94de368`.
The build archives contain a `loot_api.pyd` and a `loot_api.dll`: see the usage section below on how to use them.
2016-08-07 21:23:23 +01:00
## Build Instructions
2016-08-13 15:00:01 +01:00
The module's build system uses [CMake](https://cmake.org/) and requires [Python](https://www.python.org) (tested with 2.7). Make sure they're installed, then run CMake, and build the generated solution file.
2016-08-07 21:23:23 +01:00
Only Windows support has been tested, though Linux builds should also be possible.
## Usage
Copy the `loot_api.pyd` file that is built and the `loot_api.dll` file in the same directory to wherever you wish to import the module from, then:
```
>>> import loot_api
2016-08-13 15:00:01 +01:00
>>> loot_api.is_compatible(0,9,0)
2016-08-07 21:23:23 +01:00
True
```
2016-08-13 15:00:01 +01:00
The DLL requires the [Visual C++ 2015 Redistributable (x86)](https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe) to be installed.
**Note:** The module is currently built against revision [e40624c](https://github.com/loot/loot/tree/e40624cf7498f69b9393a02572a1eaf31065df44) of the API, which is post-0.9.2 and pre-0.10.0, but uses the v0.10 metadata syntax (as specified at that revision, in case there are further changes before the v0.10 release).