Python package for ilivalidator.
Project description
ilivalidator
Python package for ilivalidator.
Ilivalidator is compiled to a native shared library with GraalVM. This Python package calls the native shared library.
The native shared libs are built with Github Actions and thus are available for macOS, Ubuntu and Windows (all OS are x86_64).
Installation
pip install ilivalidator
Run
from ilivalidator import Ilivalidator
valid = Ilivalidator.validate(['path/to/foo.xtf'])
print("The file is valid: {}".format(valid))
Options are set with a dictionary:
from ilivalidator import Ilivalidator
settings = {Ilivalidator.SETTING_ALL_OBJECTS_ACCESSIBLE: True}
valid = Ilivalidator.validate(["file1.xtf","file2.xtf"], settings)
Supported options:
Python package | Ilivalidator |
---|---|
SETTING_ILIDIRS |
--modeldir |
SETTING_MODELNAMES |
--models |
SETTING_ALL_OBJECTS_ACCESSIBLE |
--allObjectsAccessible |
SETTING_LOGFILE |
--log |
SETTING_LOGFILE_TIMESTAMP |
--logtime |
SETTING_XTFLOG |
--xtflog |
trace |
--trace |
You have to use True/False
for options without arguments, e.g. SETTING_ALL_OBJECTS_ACCESSIBLE
.
Develop
Requirements
On Ubuntu 22.04:
sudo apt update
sudo apt install python3-pip
sudo apt install python3.10-venv
sudo apt-get install unzip zip
sudo apt-get install build-essential libz-dev zlib1g-dev
The latter two are needed for SDKMan and GraalVM Native Image.
Python setup
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade setuptools wheel
Building
python3 setup.py sdist bdist_wheel
python3 setup.py sdist bdist_wheel --plat-name=manylinux2014_aarch64
python3 setup.py sdist bdist_wheel --plat-name=manylinux2014_x86_64
Install locally
pip install -e .
pip install -e .[test]
Running tests
pytest ilivalidator
Dev environment
You can use Multipass for using Ubuntu as Development environment:
multipass launch jammy --cpus 4 --disk 20G --memory 8G --name pylitools-dev
multipass mount $HOME/sources pylitools-dev:/home/ubuntu/sources
multipass shell pylitools-dev
multipass stop pylitools-dev
Install Java:
sudo apt-get update
sudo apt-get install gcc zlib1g-dev build-essential zip unzip
curl -s "https://get.sdkman.io" | bash
source "/home/ubuntu/.sdkman/bin/sdkman-init.sh"
sdk i java 21-graalce
Compile shared lib:
./gradlew clean test nativeCompile
JAVA_HOME
muss gesetzt sein. Notfalls einmal aus- und einloggen, wenn man in der gleichen Session Java installiert hat.
Todo
- Tests: Wie kann die shared lib getestet werden?
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for ilivalidator-0.0.3-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e37b805ba2dc3faf1c2db0a40a9d6b63188c4162cc1069aab6d8dd279cb30060 |
|
MD5 | 7eddd6df18190ae0e8d9e950ba7c5a96 |
|
BLAKE2b-256 | 16f452265151eae908f0a21c938e29093a89a849a8abef1c75f739152826bed5 |
Hashes for ilivalidator-0.0.3-py3-none-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e7123b13b182580f9780049e9ada79076dbe341914b5c4e2516f016d0b9fb86 |
|
MD5 | ee8e6003043b2be3c717d87ac0a76334 |
|
BLAKE2b-256 | e5eff994789271275ad3986ed28a55945464d9f65e191679f1301ade4ca99ab9 |
Hashes for ilivalidator-0.0.3-py3-none-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bb47c81b81a8a3cf9aa59293472e8a82feb3552642a3683126a31594675b8c7 |
|
MD5 | a360744182fd72c9d426e98646fd280b |
|
BLAKE2b-256 | 6968f5248d6866608ff44793de9b2e131dc732f43b219b78bdbf8cd0df3203a5 |