Run and Validate VTL Scripts
Project description
VTL Engine
Introduction
The VTL Engine is a Python library that allows you to validate and run VTL scripts. It is a Python-based library around the VTL Language.
Installation
Requirements
The VTL Engine requires Python 3.10 or higher.
Install with pip
To install the VTL Engine on any Operating System, you can use pip:
pip install vtlengine
Note: it is recommended to install the VTL Engine in a virtual environment.
Usage
Semantic Analysis
To perform the validation of a VTL script, please use the semantic_analysis function. Here is an example:
from API import semantic_analysis
from pathlib import Path
base_path = Path(__file__).parent / "testSuite/API/data/"
script = base_path / Path("vtl/1.vtl")
datastructures = base_path / Path("DataStructure/input")
value_domains = base_path / Path("ValueDomain/VD_1.json")
external_routines = base_path / Path("sql/1.sql")
semantic_analysis(script=script, data_structures=datastructures,
value_domains=value_domains, external_routines=external_routines)
The semantic analysis function will return a dictionary of the computed datasets and their structure.
Run VTL Scripts
To execute a VTL script, please use the run function. Here is an example:
from API import run
from pathlib import Path
base_path = Path(__file__).parent / "testSuite/API/data/"
script = base_path / Path("vtl/1.vtl")
datastructures = base_path / Path("DataStructure/input")
datapoints = base_path / Path("DataSet/input")
output_folder = base_path / Path("DataSet/output")
value_domains = None
external_routines = None
run(script=script, data_structures=datastructures, datapoints=datapoints,
value_domains=value_domains, external_routines=external_routines,
output_path=output_folder, return_only_persistent=True
)
The VTL engine will load each datapoints file as being needed, reducing the memory footprint. When the output parameter is set, the engine will write the result of the computation to the output folder, else it will include the data in the dictionary of the computed datasets.
For more information on usage, please refer to the API documentation.
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
Built Distribution
File details
Details for the file vtlengine-1.0.tar.gz
.
File metadata
- Download URL: vtlengine-1.0.tar.gz
- Upload date:
- Size: 204.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e9a1c77e6ce8b6fab0820b185f0f9042ccb81c7c6e34512061dac66adc794ba |
|
MD5 | 724b54e8b6a9a86f8a2bce8cfc8e7701 |
|
BLAKE2b-256 | 0cee28ce45f2600292e19268c58c86c245736921ec4c6c570c8ec6536074b799 |
File details
Details for the file vtlengine-1.0-py3-none-any.whl
.
File metadata
- Download URL: vtlengine-1.0-py3-none-any.whl
- Upload date:
- Size: 227.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e48ccc28b5b18cf35289a0be41460cb0e22ae9daa6e17ea6e9650d843a236a8 |
|
MD5 | cc44a808a91ad0b5077023a513876660 |
|
BLAKE2b-256 | c39662c872498b36245b2a09e76aa591d3e761503a592909de59461e5c399d29 |