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
File details
Details for the file ilivalidator-0.0.4.tar.gz
.
File metadata
- Download URL: ilivalidator-0.0.4.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 044da5b832f0f72af60d0af9e3acd317c9db68116ecbbb90250a991c9f28707f |
|
MD5 | 32515cca651e04757b1da107a6deb4c0 |
|
BLAKE2b-256 | e1b81c9b1ab17a974dc0af08531dfef77be99d28fa57edadf0bd26dfe752233f |
File details
Details for the file ilivalidator-0.0.4-py3-none-win_amd64.whl
.
File metadata
- Download URL: ilivalidator-0.0.4-py3-none-win_amd64.whl
- Upload date:
- Size: 18.3 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7236edec274f106aa0ce375a6de2c1fe0952145717a65d1080822aca1c55552 |
|
MD5 | 800f5958fb0712f7fd55903dac256a36 |
|
BLAKE2b-256 | 2750c33663e7498351ae5b23666aaf3c43e81646641bb7f7d95fc6557288b5e2 |
File details
Details for the file ilivalidator-0.0.4-py3-none-manylinux2014_x86_64.whl
.
File metadata
- Download URL: ilivalidator-0.0.4-py3-none-manylinux2014_x86_64.whl
- Upload date:
- Size: 18.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 040752e1d8a6907bbcb923f4ed1dea8bafb0c50fc32d917023c9d4e2277c8c48 |
|
MD5 | cec4c918cc9bb4c959bb7550c559ffd9 |
|
BLAKE2b-256 | f04d150254b9a6c5a52a29d43bb8dc6a9d16c93361e891a0b22cc4e123baf026 |
File details
Details for the file ilivalidator-0.0.4-py3-none-manylinux2014_aarch64.whl
.
File metadata
- Download URL: ilivalidator-0.0.4-py3-none-manylinux2014_aarch64.whl
- Upload date:
- Size: 17.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3f0586dd8ef6050662cc2f854d7907b16b55d7d58231782c5e7672d909459fa |
|
MD5 | 0d3eb674f5ead4ad9750f0ffb0b0685d |
|
BLAKE2b-256 | 9f21a10d10c3c2d9f1c648fedc843ca6c7f174e9275e2845ea05db4ab15a4334 |
File details
Details for the file ilivalidator-0.0.4-py3-none-macosx_12_0_x86_64.whl
.
File metadata
- Download URL: ilivalidator-0.0.4-py3-none-macosx_12_0_x86_64.whl
- Upload date:
- Size: 18.1 MB
- Tags: Python 3, macOS 12.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 329ab01041f5d9d10d6d8d06fc48bd7e9bdbb9e3e81b9480290fc2bcc08cedc3 |
|
MD5 | 6642f848c5a52831c0afad95bf29a37c |
|
BLAKE2b-256 | 02098a4dbf8d5305ae4101f948d0dd079f8adc9a612500effd2ad843318a0c35 |