Skip to main content

A standalone JSON Schema based validator for XDI files used to save XAS data aiming to be fully compliant with the XDI/1.0 specification..

Project description

XDI-Validator

A standalone JSON Schema based validator for XDI files used to save XAS data aiming to be fully compliant with the XDI/1.0 specification..

Usage

As simple as it gets :

# import the functionality from the module
from xdi_validator import validate, XDIEndOfHeaderMissingError

# open the xdi file
with open('filename.xdi', 'r') as xdi_document:
    
    # Validate the file. If there is no end-of-header token
    # an exception is raised
    try:
        xdi_errors, xdi_dict = validate(xdi_document)
    except XDIEndOfHeaderMissingError as ex:
        print(ex.message)
        
    # check if there are errors
    if xdi_errors:
        print('XDI is invalid!')
        for error in xdi_errors:
            print(error)
    else:
        print('XDI is valid!')
        print(xdi_dict)
    

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

xdi_validator-1.0.0a0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xdi_validator-1.0.0a0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file xdi_validator-1.0.0a0.tar.gz.

File metadata

  • Download URL: xdi_validator-1.0.0a0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xdi_validator-1.0.0a0.tar.gz
Algorithm Hash digest
SHA256 5c7548b4370d9275c41d458d619cad97466da243bd3dec3a4103f49db9aa181f
MD5 70022975474f9de1ee033493cae54699
BLAKE2b-256 38b2bf9c0c442575559f7595ce3e7b8356ca4ee7ade9a700080055b60719ee87

See more details on using hashes here.

File details

Details for the file xdi_validator-1.0.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for xdi_validator-1.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 10beeb5d50ae62f97259bcdb17af703f38213aa5ae6ca135b47478af4440f1ef
MD5 4d41cbf5760a1b45a521be05b094fb61
BLAKE2b-256 2871f5db262e13702f46c8b087b4b80e3755e83ca682e597c3060f9f4f42e732

See more details on using hashes here.

Supported by

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