Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Python Type validator with decorators

Project description

# python-type-valid

[![Python type valid Build passed](](
[![Python type valid Code Coverage](](

Python type validation decorator, validates input and output types

### Installation
pip install type-valid

### Usage
from type_valid import type_valid

def hello(name: str) -> str:
return name



def user(name: str, age: int, salary: float) -> str:
return name+str(age)+str(salary)

user(name="Bob", age=25, salary=1000.00)


### Raises TypeError
TypeError: in method 'hello', Argument 'name' is not of type <class 'str'>, received <class 'int'>

### Todo:
* Validate input DONE
* Validate Output DONE
* Validate input **kwargs ?
* Validate mandatory **kwargs ?
* Multiple types ?

### Types examples

str ""
int 4
float 10.5
list []
tuple ()

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for type-valid, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size type_valid-0.1.5-py3-none-any.whl (2.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size type_valid-0.1.5.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page