Skip to content

BSI-Bund/nist-validator

Repository files navigation

NIST-ITL-Validator

This project contains tools to generate, view, edit and validate ANSI/NIST-ITL files, in particular the ANSI/NIST-ITL 1-2011 Update: 2015 version.

The project consists of 3 modules:

  • nist_validator: A python library for parsing, editing, validating and writing NIST-ITL files.
  • nist_validator_cli: A command-line interface (CLI) module for handling NIST-ITL files (uses nist_validator).
  • nist_validator_gui: A graphical user interface (GUI) module for handling NIST-ITL files (uses nist_validator).

Glossary

  • Transaction: A transaction is the data that fits into one NIST-ITL file. See Section "5.1 Structure of a transaction" of the NIST-ITL Standard.
  • Record: A record is comprised of fields. Multiple records make up a transaction.
  • Field: A field may have one or multiple values (called subfields in the standard). Each value can either be a simple value or a collection of information items.
  • Info Item: Abbreviation for information item. See "Field".

Quickstart: CLI and GUI

This guide assumes you already have the following files:

  • nist_validator-0.1.0-py3-none-any.whl
  • nist_validator_cli-0.1.0-py3-none-any.whl
  • nist_validator_gui-0.1.0-py3-none-any.whl

Installation

1. Set Up the Environment

  • Create a directory for the installation, e.g., nist_validator.
  • Copy the above .whl files into this directory.

2. Install the Packages

On Linux/macOS:
python3 -m venv venv
source venv/bin/activate
python -m pip install nist_validator-0.1.0-py3-none-any.whl
python -m pip install nist_validator_cli-0.1.0-py3-none-any.whl
python -m pip install nist_validator_gui-0.1.0-py3-none-any.whl
deactivate
On Windows:
python -m venv venv
venv\Scripts\activate
python -m pip install nist_validator-0.1.0-py3-none-any.whl
python -m pip install nist_validator_cli-0.1.0-py3-none-any.whl
python -m pip install nist_validator_gui-0.1.0-py3-none-any.whl
deactivate

3. (Optional) Cleanup

Once the installation is complete, you can safely delete the .whl files as they are no longer needed. Usage

Usage

After installation, you can run:

  • CLI version:
    • venv/Scripts/nival (Windows) or
    • venv/bin/nival (Linux/macOS)
  • GUI version:
    • venv/Scripts/nival_gui (Windows) or
    • venv/bin/nival_gui (Linux/macOS)

Updating

To update an existing installation, simply follow the installation steps again. The new versions will replace the old ones.

Uninstallation

To completely remove the installation, delete the venv directory or the installation directory (nist_validator, if following step 1).

Installation

To install and use the modules follow these steps:

  1. Package
  2. Install
  3. Verify packages (optional)
  4. Run

Package

Run:

python dev_util/package_modules.py

You will find the generated packages (*.tar.gz and .whl files) in the dist folder.

Install

Install the desired packages into your project by running this from your project root:

Option 1: Pre-built (faster, without source code):

python -m pip install path/to/nist_validator-0.1.0-py3-none-any.whl
python -m pip install path/to/nist_validator_cli-0.1.0-py3-none-any.whl
python -m pip install path/to/nist_validator_gui-0.1.0-py3-none-any.whl

Option 2: Source distribution (slower, with source code):

python -m pip install path/to/nist_validator-0.1.0.tar.gz
python -m pip install path/to/nist_validator_cli-0.1.0.tar.gz
python -m pip install path/to/nist_validator_gui-0.1.0.tar.gz

Note: Using .whl files installs pre-built packages for faster set-up, using .tar.gz files includes the source code and requires building during installation.

Verify packages (optional)

There is a helper script to test if the *.tar.gz and .whl files can be installed:

python dev_util/validate_packaged_modules.py

This creates a virtual environment in the dist folder, and then installs and tests the modules it can find.

Run

See the respective README.md files per module.

Developer Setup

To start developing, checkout/clone this repo and then run:

python dev_util/setup_developer_env.py

You can run this script as often as desired.

This will create a virtual environment venv and install in venv:

  • requirements-dev.txt: The dependencies for formatting, testing, packaging and committing the code.
  • The modules nist_validator, nist_validator_cli and nist_validator_gui in editable mode.

You can now start your integrated development environment (IDE). Direct it to the virtual environment venv and start running/editing the code.

Troubleshooting

Sometimes IDEs have problems recognizing the editable modules. In that case, it can help to:

  1. close the IDE
  2. remove the venv folder
  3. re-run python dev_util/setup_developer_env.py (even two times can be helpful)
  4. re-open the IDE

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages