# ilivalidator
Python package for [ilivalidator](https://github.com/claeis/ilivalidator).
Ilivalidator is compiled to a [native shared library](https://www.graalvm.org/latest/reference-manual/native-image/guides/build-native-shared-library/) with [GraalVM](https://graalvm.org). 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?
Raw data
{
"_id": null,
"home_page": "https://github.com/pylitools/ilivalidator",
"name": "ilivalidator",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "ilivalidator,interlis",
"author": "Stefan Ziegler",
"author_email": "edi.gonzales@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e1/b8/1c9b1ab17a974dc0af08531dfef77be99d28fa57edadf0bd26dfe752233f/ilivalidator-0.0.4.tar.gz",
"platform": null,
"description": "# ilivalidator\nPython package for [ilivalidator](https://github.com/claeis/ilivalidator).\n\nIlivalidator is compiled to a [native shared library](https://www.graalvm.org/latest/reference-manual/native-image/guides/build-native-shared-library/) with [GraalVM](https://graalvm.org). This Python package calls the native shared library.\n\nThe native shared libs are built with Github Actions and thus are available for macOS, Ubuntu and Windows (all OS are x86_64).\n\n## Installation\n\n```\npip install ilivalidator\n```\n\n## Run\n\n```\nfrom ilivalidator import Ilivalidator\n\nvalid = Ilivalidator.validate(['path/to/foo.xtf'])\nprint(\"The file is valid: {}\".format(valid))\n```\n\nOptions are set with a dictionary:\n\n```\nfrom ilivalidator import Ilivalidator\n\nsettings = {Ilivalidator.SETTING_ALL_OBJECTS_ACCESSIBLE: True}\nvalid = Ilivalidator.validate([\"file1.xtf\",\"file2.xtf\"], settings)\n```\n\nSupported options:\n\n| Python package | Ilivalidator |\n| --- | --- |\n| `SETTING_ILIDIRS` | `--modeldir` |\n| `SETTING_MODELNAMES` | `--models` |\n| `SETTING_ALL_OBJECTS_ACCESSIBLE` | `--allObjectsAccessible` |\n| `SETTING_LOGFILE` | `--log` |\n| `SETTING_LOGFILE_TIMESTAMP` | `--logtime` |\n| `SETTING_XTFLOG` | `--xtflog` |\n| `trace` | `--trace` |\n\nYou have to use `True/False` for options without arguments, e.g. `SETTING_ALL_OBJECTS_ACCESSIBLE`.\n\n## Develop\n\n### Requirements\nOn Ubuntu 22.04:\n\n```\nsudo apt update\nsudo apt install python3-pip\nsudo apt install python3.10-venv\nsudo apt-get install unzip zip\nsudo apt-get install build-essential libz-dev zlib1g-dev\n```\n\nThe latter two are needed for SDKMan and GraalVM Native Image.\n\n### Python setup\n\n```\npython3 -m venv .venv\nsource .venv/bin/activate\npython3 -m pip install --upgrade setuptools wheel\n```\n\n### Building\n\n```\npython3 setup.py sdist bdist_wheel\npython3 setup.py sdist bdist_wheel --plat-name=manylinux2014_aarch64 \npython3 setup.py sdist bdist_wheel --plat-name=manylinux2014_x86_64 \n```\n\n### Install locally\n\n```\npip install -e .\npip install -e .[test]\n```\n\n### Running tests\n\n```\npytest ilivalidator\n```\n\n### Dev environment\n\nYou can use Multipass for using Ubuntu as Development environment:\n\n```\nmultipass launch jammy --cpus 4 --disk 20G --memory 8G --name pylitools-dev\nmultipass mount $HOME/sources pylitools-dev:/home/ubuntu/sources\nmultipass shell pylitools-dev\nmultipass stop pylitools-dev\n```\n\nInstall Java:\n\n```\nsudo apt-get update \nsudo apt-get install gcc zlib1g-dev build-essential zip unzip\n\ncurl -s \"https://get.sdkman.io\" | bash\nsource \"/home/ubuntu/.sdkman/bin/sdkman-init.sh\"\nsdk i java 21-graalce\n```\n\nCompile shared lib:\n```\n./gradlew clean test nativeCompile\n```\n`JAVA_HOME` muss gesetzt sein. Notfalls einmal aus- und einloggen, wenn man in der gleichen Session Java installiert hat.\n\n\n## Todo\n- Tests: Wie kann die shared lib getestet werden? \n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Python package for ilivalidator.",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/pylitools/ilivalidator"
},
"split_keywords": [
"ilivalidator",
"interlis"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "02098a4dbf8d5305ae4101f948d0dd079f8adc9a612500effd2ad843318a0c35",
"md5": "6642f848c5a52831c0afad95bf29a37c",
"sha256": "329ab01041f5d9d10d6d8d06fc48bd7e9bdbb9e3e81b9480290fc2bcc08cedc3"
},
"downloads": -1,
"filename": "ilivalidator-0.0.4-py3-none-macosx_12_0_x86_64.whl",
"has_sig": false,
"md5_digest": "6642f848c5a52831c0afad95bf29a37c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 18063011,
"upload_time": "2023-09-27T18:18:40",
"upload_time_iso_8601": "2023-09-27T18:18:40.666053Z",
"url": "https://files.pythonhosted.org/packages/02/09/8a4dbf8d5305ae4101f948d0dd079f8adc9a612500effd2ad843318a0c35/ilivalidator-0.0.4-py3-none-macosx_12_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9f21a10d10c3c2d9f1c648fedc843ca6c7f174e9275e2845ea05db4ab15a4334",
"md5": "0d3eb674f5ead4ad9750f0ffb0b0685d",
"sha256": "f3f0586dd8ef6050662cc2f854d7907b16b55d7d58231782c5e7672d909459fa"
},
"downloads": -1,
"filename": "ilivalidator-0.0.4-py3-none-manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "0d3eb674f5ead4ad9750f0ffb0b0685d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 17731199,
"upload_time": "2023-09-27T18:18:43",
"upload_time_iso_8601": "2023-09-27T18:18:43.424533Z",
"url": "https://files.pythonhosted.org/packages/9f/21/a10d10c3c2d9f1c648fedc843ca6c7f174e9275e2845ea05db4ab15a4334/ilivalidator-0.0.4-py3-none-manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f04d150254b9a6c5a52a29d43bb8dc6a9d16c93361e891a0b22cc4e123baf026",
"md5": "cec4c918cc9bb4c959bb7550c559ffd9",
"sha256": "040752e1d8a6907bbcb923f4ed1dea8bafb0c50fc32d917023c9d4e2277c8c48"
},
"downloads": -1,
"filename": "ilivalidator-0.0.4-py3-none-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "cec4c918cc9bb4c959bb7550c559ffd9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 18463771,
"upload_time": "2023-09-27T18:18:46",
"upload_time_iso_8601": "2023-09-27T18:18:46.860108Z",
"url": "https://files.pythonhosted.org/packages/f0/4d/150254b9a6c5a52a29d43bb8dc6a9d16c93361e891a0b22cc4e123baf026/ilivalidator-0.0.4-py3-none-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2750c33663e7498351ae5b23666aaf3c43e81646641bb7f7d95fc6557288b5e2",
"md5": "800f5958fb0712f7fd55903dac256a36",
"sha256": "d7236edec274f106aa0ce375a6de2c1fe0952145717a65d1080822aca1c55552"
},
"downloads": -1,
"filename": "ilivalidator-0.0.4-py3-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "800f5958fb0712f7fd55903dac256a36",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 18271649,
"upload_time": "2023-09-27T18:18:49",
"upload_time_iso_8601": "2023-09-27T18:18:49.924550Z",
"url": "https://files.pythonhosted.org/packages/27/50/c33663e7498351ae5b23666aaf3c43e81646641bb7f7d95fc6557288b5e2/ilivalidator-0.0.4-py3-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e1b81c9b1ab17a974dc0af08531dfef77be99d28fa57edadf0bd26dfe752233f",
"md5": "32515cca651e04757b1da107a6deb4c0",
"sha256": "044da5b832f0f72af60d0af9e3acd317c9db68116ecbbb90250a991c9f28707f"
},
"downloads": -1,
"filename": "ilivalidator-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "32515cca651e04757b1da107a6deb4c0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4625,
"upload_time": "2023-09-27T18:18:53",
"upload_time_iso_8601": "2023-09-27T18:18:53.820789Z",
"url": "https://files.pythonhosted.org/packages/e1/b8/1c9b1ab17a974dc0af08531dfef77be99d28fa57edadf0bd26dfe752233f/ilivalidator-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-27 18:18:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pylitools",
"github_project": "ilivalidator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ilivalidator"
}