Coder Social home page Coder Social logo

ilivalidator's Introduction

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?

ilivalidator's People

Contributors

edigonzales avatar tugark avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.