Skip to content

to_camelcase

faststream.asyncapi.utils.to_camelcase #

to_camelcase(*names: str) -> str

Converts a list of names to camel case.

PARAMETER DESCRIPTION
*names

Variable length list of names to be converted to camel case.

TYPE: str DEFAULT: ()

RETURNS DESCRIPTION
str

The camel case representation of the names.

Example

to_camelcase("hello_world") "HelloWorld"

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Source code in faststream/asyncapi/utils.py
def to_camelcase(*names: str) -> str:
    """Converts a list of names to camel case.

    Args:
        *names: Variable length list of names to be converted to camel case.

    Returns:
        The camel case representation of the names.

    Example:
        >>> to_camelcase("hello_world")
        "HelloWorld"
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    return " ".join(names).replace("_", " ").title().replace(" ", "")

Last update: 2023-11-13