Metadata-Version: 2.1
Name: pyautocast
Version: 0.1.1
Summary: Automatic function arguments casting
Home-page: https://github.com/ctgk/pyautocast
Author: ctgk
Author-email: r1135nj54w@gmail.com
Maintainer: ctgk
Maintainer-email: r1135nj54w@gmail.com
License: MIT
Description: # pyautocast
        Python library to automatically cast function arguments using decorator.
        
        ## Install
        
        ```bash
        pip install pyautocast
        ```
        
        ## Usage
        
        ```py
        >>> from pyautocast import autocast
        >>> @autocast(x=str)
        ... def func(x):
        ...     assert(isinstance(x, str))
        ...     return "arg 'x' in func() is " + x
        ...
        >>> func(2)
        "arg 'x' in func() is 2"
        >>> func([1, 2, 3])
        "arg 'x' in func() is [1, 2, 3]"
        ```
        
        ```py
        >>> from pyautocast import CustomCast
        >>> mycast = CustomCast()
        >>> mycast.add_cast_rule(int, tuple, lambda x: (x, x))
        >>> @mycast.autocast(x=tuple)
        ... def func(x):
        ...     print(x)
        >>> func(2)
        (2, 2)
        >>> func(-4.5)
        Traceback (most recent call last):
        ...
        TypeError: 'float' object is not iterable
        ```
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: develop
