Metadata-Version: 2.3
Name: PYTypeValidator
Version: 0.1.0
Summary: A simple utility class to validate and convert types in Python
License: MIT
Author: Ch Ahmed ahmedchouikh78@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Project-URL: Homepage, https://github.com/Ahmed775c6/TypeValidatorv1
Project-URL: Repository, https://github.com/Ahmed775c6/TypeValidatorv1
Description-Content-Type: text/markdown

# TypeValidator Class

## Overview

The `TypeValidator` class is a simple utility designed to validate the types of variables in Python. It provides methods to validate the type of a single value as well as multiple values against their expected types. This can be especially useful for ensuring data integrity and correctness in your code when dealing with dynamic data or user inputs.

## Features

- **Single value validation**: Validate if a single value matches the expected type.
- **Multiple value validation**: Validate a list of values against a list of expected types.
- **Error handling**: Raises an exception if the number of values does not match the number of expected types in batch validation.

## Methods

### `validate(self, value, expected_type)`

This method validates whether a single value matches the expected type.

**Parameters**:
- `value`: The value to check.
- `expected_type`: The type that the value is expected to be.

**Returns**:
- `True` if the value matches the expected type, otherwise `False`.

**Example Usage**:
```python
// Validate a single Variabale
type_validator = TypeValidator()
result = type_validator.validate(42, int)
print(result)  # Output: True

// Check multiple values
id  = 0
email = 1
isActiveAccount = False
Amount = 12.78

values = [id, email,isActiveAccount, Amount]
expected_types = [int, str,bool, float]
print(validator.validate_all(values, expected_types))# [True,False, True, True]
