Skip to main content

A Python package for validating NeXus files

Project description

Introduction

This package provides a Python API to inspect and validate NeXus files written in the HDF5 format.

The latest development version is always available from NeXpy's GitHub repository.

Installation

Released versions of nxvalidate can be installed using

    % pip install nxvalidate

The source code can be downloaded from the NeXpy Git repository:

    % git clone http://github.com/nexpy/nxvalidate.git

Prerequisites

The only prerequisite required to install the nxvalidate package is the nexusformat package. There are more details of further dependencies in the NeXpy documentation.

Usage

At the moment, the nxvalidate package provides a single command-line script.

% nxinspect -h
usage: nxinspect [-h] [-f FILENAME] [-p PATH] [-a [APPLICATION]]
                 [-b BASECLASS] [-i] [-w] [-e] [-v]

Inspects and validates NeXus files.

options:
  -h, --help            show this help message and exit
  -f FILENAME, --filename FILENAME
                        name of the NeXus file to be validated
  -p PATH, --path PATH  path to group to be validated in the NeXus file
  -b BASECLASS, --baseclass BASECLASS
                        name of the base class to be listed
  -a [APPLICATION], --application [APPLICATION]
                        validate the NeXus file against its application definition
  -d DEFINITIONS, --definitions DEFINITIONS
                        path to the directory containing NeXus definitions
  -i, --info            output info messages in addition to warnings and errors
  -w, --warning         output info messages in addition to warnings and errors
  -e, --error           output info messages in addition to warnings and errors
  -v, --version         show program's version number and exit

N.B., the command is nxinspect, rather than nxvalidate to avoid confusion with the C-library.

Examples

  1. To compare the contents of a NeXus file with the base classes defined by the NeXus standard and print conflicting fields or groups, type:
    % nxinspect -f <filename.nxs> -e
    
    The --info, --warning and --error switches control how much information is output. The default is --warning.
  2. To compare the contents of a NeXus file with the base classes defined in a different directory to the installed package, type:
    % nxinspect -f <filename.nxs> -d /path/to/definitions
    
    The directory should contain two sub-directories, applications and base_classes containing the NXDL files needed to validate the specified NeXus file.
  3. To check whether the contents of the NeXus file conform to the required contents of the application definition specified in the file, type:
    % nxinspect -f <filename.nxs> -a
    
  4. To check whether the contents of the NeXus file conform to the required contents of an application definition file, type:
    % nxinspect -f <filename.nxs> -a <application.nxdl.xml>
    
  5. To print the contents of a base class, type:
    % nxinspect -b <base-class-name>
    

User Support

Information about the Python API for reading and writing NeXus files is available as part of the NeXpy documentation. If you have any general questions concerning the use of this package, please address them to the NeXus Mailing List. If you discover any bugs, please submit a Github issue, preferably with relevant tracebacks.

Acknowledgements

This package was developed jointly by Kaitlyn Marlor, Justin Wozniak, and Ray Osborn. The NeXus data format standard has been developed under the supervision of the NeXus International Advisory Committee.

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

nxvalidate-0.3.3b1.tar.gz (602.0 kB view details)

Uploaded Source

Built Distribution

nxvalidate-0.3.3b1-py3-none-any.whl (833.5 kB view details)

Uploaded Python 3

File details

Details for the file nxvalidate-0.3.3b1.tar.gz.

File metadata

  • Download URL: nxvalidate-0.3.3b1.tar.gz
  • Upload date:
  • Size: 602.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for nxvalidate-0.3.3b1.tar.gz
Algorithm Hash digest
SHA256 7354c1437fbf57e02a661c72d5dc0e2c535291b78018eff4d9f2f011dc19f912
MD5 d0597c354c8260cd344bcdf61dc134fd
BLAKE2b-256 0054c4d339aaa6395a773711f70d8f3d6baa886e1de0689e2e2c502dde5039ec

See more details on using hashes here.

File details

Details for the file nxvalidate-0.3.3b1-py3-none-any.whl.

File metadata

  • Download URL: nxvalidate-0.3.3b1-py3-none-any.whl
  • Upload date:
  • Size: 833.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for nxvalidate-0.3.3b1-py3-none-any.whl
Algorithm Hash digest
SHA256 a4a6a574a2973e1aa5b7612a151c14b7a213281896f4985bdbd08507bcedec91
MD5 e9ba7245e27b8fd76c9ec9a2a99dba34
BLAKE2b-256 a6ad80ddfbefd957d147d2f77492f1b81feb9c9f5c3bb978e30c443ac267fb90

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page