Skip to main content

Vedro Valera Validator

Codecov PyPI PyPI - Downloads Python Version

⚠️ This package has been renamed to vedro-d42-validator. The vedro-valera-validator package on PyPI is no longer maintained. For updates and improvements, please use vedro-d42-validator going forward.

Installation

Quick

For a quick installation, you can use a plugin manager as follows:

$ vedro plugin install vedro-valera-validator

Manual

To install manually, follow these steps:

  1. Install the package using pip:
$ pip3 install vedro-valera-validator
  1. Next, activate the plugin in your vedro.cfg.py configuration file:
# ./vedro.cfg.py
import vedro
import vedro_valera_validator

class Config(vedro.Config):

    class Plugins(vedro.Config.Plugins):

        class ValeraValidator(vedro_valera_validator.ValeraValidator):
            enabled = True

Usage

Here is an example scenario demonstrating how to decode a base64 encoded string:

# ./scenarios/decode_base64_encoded_string.py
import vedro
from base64 import b64decode
from d42 import schema

class Scenario(vedro.Scenario):
    subject = "decode base64 encoded string"

    def given(self):
        self.encoded = "Y3VjdW1iZXI="

    def when(self):
        self.result = {
            "result": b64decode(self.encoded)
        }

    def then(self):
        assert self.result == schema.dict({
            "result": schema.bytes(b"banana")
        })

Run the test using the command:

$ vedro run

If the expected and actual results don't match, a ValidationException will be raised, as illustrated below:

ValidationException:
 - Value <class 'bytes'> at _['result'] must be equal to b'banana', but b'cucumber' given

Release files for vedro-valera-validator 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vedro-valera-validator 1.2.1
File Size Uploaded
vedro_valera_validator-1.2.1.tar.gz 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vedro-valera-validator 1.2.1
File Interpreter ABI Platform
vedro_valera_validator-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / vedro_valera_validator-1.2.1.tar.gz

Download URL vedro_valera_validator-1.2.1.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
541eaa21b59772812becec5ed2c50f3f335971813825831423c5510ee17ddf0b
BLAKE2b-256 checksum
How to use checksums
29f455bc6a98d95c715af81f2f81aca2ef56f00560f585bbf0881d8482a94de7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / vedro_valera_validator-1.2.1-py3-none-any.whl

Download URL vedro_valera_validator-1.2.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
622fe9a70d016ad818ee0c2bdae35f414e35f83568112d2fe0459edcd6f771dd
BLAKE2b-256 checksum
How to use checksums
67871638c8abeea38ec156eba6bce229db33900f51352c7c28e95bc2a85464a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page