Skip to content

Pyguard is a Python library that intends to provide users with a function wrapper that validates parameters.

License

Notifications You must be signed in to change notification settings

greydevv/pyguardian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyguardian

Description

pyguardian is a type-checker for method parameters. Methods are type-checked at runtime via the guard decorator:

from pyguardian import guard

@guard(int, int)
def add(a, b):
    return a+b

# Successful call
>>> add(1,2)
3

# Unsccessful call ("2" is not an integer!)
>>> add(1,"2")
InvalidArgumentTypeError: 'add' expects value of type 'int' for parameter 'b' but got 'str'

Installation

pip install pyguardian

Documentation

See DOCUMENTATION.md

License

pyguardian is licensed under the MIT License.

About

Pyguard is a Python library that intends to provide users with a function wrapper that validates parameters.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages