casing/casing.py
def transform(var, case="snake"):
    """
    Transform the input into the indicated case.
    
    :param var: Variable to transform
    :param case: Case convention. Can be any available case. 
    
    :type var: :py:class:`str` / :py:class:`list`
    :type case: :py:class:`str`
    
    :returns: **transformed**: (:py:class:`str`) - Transformed input `var` in `case` convention
    
    .. code-block:: python
        :linenos:
    
        import casing
        print(casing.transform("stringToTransform", "snakeuppercase"))
        >>> "STRING_TO_TRANSFORM"
        print(casing.transform(['string', 'to', 'transform'], "dashcase"))
        >>> "string-to-transform"
    """ 
    if case.endswith("case"):
        case = case[:-len("case")]
    for fct in getcases():
        if "{0}case".format(case) == fct:
            function = globals()[fct]
            if type(var) is str:
                return function(analyze(var))
            elif type(var) is list:
                return function(var)
            else:
                Exception("Invalid type input")
    else:
        raise Exception("Case '{0}' don't exists".format(case))

    Transform the input into the indicated case.
    
    :param var: Variable to transform
    :param case: Case convention. Can be any available case. 
    
    :type var: :py:class:`str` / :py:class:`list`
    :type case: :py:class:`str`
    
    :returns: **transformed**: (:py:class:`str`) - Transformed input `var` in `case` convention
    
    .. code-block:: python
        :linenos:
    
        import casing
        print(casing.transform("stringToTransform", "snakeuppercase"))
        >>> "STRING_TO_TRANSFORM"
        print(casing.transform(['string', 'to', 'transform'], "dashcase"))
        >>> "string-to-transform"
    
Transform the input into the indicated case.
Transform the input into the indicated case .
def transform(var, case="snake"):
    if case.endswith("case"):
        case = case[:-len("case")]
    for fct in getcases():
        if "{0}case".format(case) == fct:
            function = globals()[fct]
            if type(var) is str:
                return function(analyze(var))
            elif type(var) is list:
                return function(var)
            else:
                Exception("Invalid type input")
    else:
        raise Exception("Case '{0}' don't exists".format(case))
def transform ( var , case = "snake" ) : if case . endswith ( "case" ) : case = case [ : - len ( "case" ) ] for fct in getcases ( ) : if "{0}case" . format ( case ) == fct : function = globals ( ) [ fct ] if type ( var ) is str : return function ( analyze ( var ) ) elif type ( var ) is list : return function ( var ) else : Exception ( "Invalid type input" ) else : raise Exception ( "Case '{0}' don't exists" . format ( case ) )
Transform the input into the indicated case.
Transform the input into the indicated case .
"""
    Transform the input into the indicated case.
    
    :param var: Variable to transform
    :param case: Case convention. Can be any available case. 
    
    :type var: :py:class:`str` / :py:class:`list`
    :type case: :py:class:`str`
    
    :returns: **transformed**: (:py:class:`str`) - Transformed input `var` in `case` convention
    
    .. code-block:: python
        :linenos:
    
        import casing
        print(casing.transform("stringToTransform", "snakeuppercase"))
        >>> "STRING_TO_TRANSFORM"
        print(casing.transform(['string', 'to', 'transform'], "dashcase"))
        >>> "string-to-transform"
    """
transformed**: (:py:class:`str`) - Transformed input `var` in `case` convention
code-block:: python
:linenos.

import casing
print(casing.transform("stringToTransform", "snakeuppercase"))
>>> "STRING_TO_TRANSFORM"
print(casing.transform(['string', 'to', 'transform'], "dashcase"))
>>> "string-to-transform"
transformed ** : ( : py : class : ` str ` ) - Transformed input ` var ` in ` case ` convention code - block :: python : linenos . import casing print ( casing . transform ( " stringToTransform " " snakeuppercase " )) >>> " STRING_TO_TRANSFORM " print ( casing . transform ( [ ' string ' ' to ' ' transform ' ] " dashcase " )) >>> " string - to - transform "
var
Variable to transform
Variable to transform
case
Case convention. Can be any available case.
Case convention . Can be any available case .