관리-도구
편집 파일: alias_generators.cpython-38.pyc
U /?�fL � @ sD d Z ddlZdZeed�dd�Zeed�dd�Zeed �d d�ZdS )zMAlias generators for converting between different capitalization conventions.� N)� to_pascal�to_camel�to_snake)�snake�returnc C s | � � }t�ddd� |�S )z�Convert a snake_case string to PascalCase. Args: snake: The string to convert. Returns: The PascalCase string. z([0-9A-Za-z])_(?=[0-9A-Z])c S s | � d�S �N� ��group��m� r �G/opt/hc_python/lib/python3.8/site-packages/pydantic/alias_generators.py�<lambda> � zto_pascal.<locals>.<lambda>)�title�re�sub�r �camelr r r r s r c C s6 t �d| �rt �d| �s| S t| �}t �ddd� |�S )z�Convert a snake_case string to camelCase. Args: snake: The string to convert. Returns: The converted camelCase string. z^[a-z]+[A-Za-z0-9]*$z\d[a-z]z (^_*[A-Z])c S s | � d��� S r )r �lowerr r r r r ( r zto_camel.<locals>.<lambda>)r �match�searchr r r r r r r s r )r r c C s\ t �ddd� | �}t �ddd� |�}t �ddd� |�}t �dd d� |�}|�d d�}|�� S )z�Convert a PascalCase, camelCase, or kebab-case string to snake_case. Args: camel: The string to convert. Returns: The converted string in snake_case. z([A-Z]+)([A-Z][a-z])c S s | � d�� d| � d�� �S �Nr �_� r r r r r r 5 r zto_snake.<locals>.<lambda>z([a-z])([A-Z])c S s | � d�� d| � d�� �S r r r r r r r 7 r z([0-9])([A-Z])c S s | � d�� d| � d�� �S r r r r r r r 9 r z([a-z])([0-9])c S s | � d�� d| � d�� �S r r r r r r r ; r �-r )r r �replacer )r r r r r r + s r )�__doc__r �__all__�strr r r r r r r �<module> s