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
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 --mem 8G --name python-ili-build
multipass mount $HOME/sources python-ili-build:/home/ubuntu/sources
multipass shell python-ili-build
multipass stop python-ili-build
Install Java:
curl -s "https://get.sdkman.io" | bash
source ...
sdk i java 22.3.r17-grl
Todo
- Tests: Wie kann die shared lib getestet werden?
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ilivalidator-0.0.2.tar.gz
(4.4 kB
view hashes)
Built Distributions
Close
Hashes for ilivalidator-0.0.2-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13b123abc2ce9d11c91117b27a9453054b37b58550713cb98b4da98259a3ba55 |
|
MD5 | b4b48c16f89ca86dbd3af3b48e966a5d |
|
BLAKE2b-256 | 591d788aa579ec682d58617444412cf2a415d3735b851e4f55c94c2b26adadd9 |
Close
Hashes for ilivalidator-0.0.2-py3-none-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 648608399d97440735cbfbdd4a54e91d38ba3b27d968e7587756e1d0ad94f2da |
|
MD5 | 6fdb46d635fcebb9d2e4183d6c6b1ec5 |
|
BLAKE2b-256 | 0ecce5d23d7c324db6bd05d45f8a4e2fc72b75be4fa61764e110a121b0c71bd3 |
Close
Hashes for ilivalidator-0.0.2-py3-none-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f3efc1d3f035690d67838e69d987610a7cb8f106829837971b11b86749cff01 |
|
MD5 | 798a81d2bbb17f3bcc987a1340b3d92d |
|
BLAKE2b-256 | 9d152180280fc665e3fa12fe926179b210becf3aa9bf63bd588e6fc7a660df8f |