Skip to main content

XenValidator is schema validation library for Python, You can Validate Strings, Numbers, Objects, Arrays, Dates, URLs & more. You can even create your custom validators! Make sure to give it a ⭐ on github.

Project description

XenValidator

XenValidator is a powerful, flexible, and easy-to-use Python library for validating data structures. It simplifies the process of defining complex validation rules, handling cross-field dependencies, and providing informative error messages.

Features

Comprehensive Validation: Supports validation for strings, numbers, dates, arrays, urls, and custom data types.

Custom Error Handling: Easily customize error messages for various validation rules.

Flexible Date Formats: Supports multiple date formats to match various use cases.

Installation

Install XenValidator using pip:

    pip install xenvalidator

Example usage:

Import the package into to your app:

    from XenValidator import X, Object, ValidationError

Create and validate the schema.

    Schema = Object({
        "Name": X["STRING"](),
        "Age":  X["NUMBER"]().min(2),
        "Tags": X["ARRAY"](),
    })

    try:
        Data = {
            "Name": "John Doe",
            "Age": 18,
            "Tags": ["TAG1", "TAG2", "TAG3"], 
        }
        Schema.validate(Data)
        print("Data is valid:", Data)
    except ValidationError as e:
        print("Data is invalid:", e)

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

XenValidator-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

XenValidator-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file XenValidator-0.1.1.tar.gz.

File metadata

  • Download URL: XenValidator-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for XenValidator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bc5f2287ae2d6b8d9582ecd424991d309558ebca39f63d8265a5a11751e40b54
MD5 b42b4129bfc52b840e356772a02c3cdc
BLAKE2b-256 640d9f2aca0c27c77c38957e514a0186d90dbf6cf6b3017ecaaf25e7d4b16dc1

See more details on using hashes here.

File details

Details for the file XenValidator-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: XenValidator-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for XenValidator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81b6c345e499dcbc404129dc990c857834e059868fdc782b24d06eaf063b7e87
MD5 61740dbdad65b92717116c407ecdfb23
BLAKE2b-256 43696818ce05818e695b00e62490f64b8ea98ad78c693ed0dc44c6130f3a7cd1

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