argclz.validator.PathValidatorBuilder#
- class argclz.validator.PathValidatorBuilder[source]#
Bases:
AbstractTypeValidatorBuilder[Path]a path validator
Methods Summary
__init__()freeze(*args, **kwargs)(internal use) return a copy of itself.
is_dir()Check if path is a directory
Check if path exists
is_file()Check if path is a file
is_suffix(suffix)Check path suffix or in a list of suffixes
optional()__call__(value)Details
- __call__(value)#
- Parameters:
value (Any) – type-casted value.
- Returns:
True if value pass the validation.
- Raises:
ValueError – when value does not pass the validation.
- Return type:
- freeze(*args, **kwargs)#
(internal use) return a copy of itself.
- Return type:
Self
- optional()#
- Return type:
Self