1
0
mirror of synced 2026-01-02 21:02:43 -05:00
Files
airbyte/airbyte-cdk/python/airbyte_cdk/sources/utils/casing.py
Cole Snodgrass 2e099acc52 update headers from 2022 -> 2023 (#22594)
* It's 2023!

* 2022 -> 2023

---------

Co-authored-by: evantahler <evan@airbyte.io>
2023-02-08 13:01:16 -08:00

13 lines
244 B
Python

#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import re
# https://stackoverflow.com/a/1176023
def camel_to_snake(s):
s = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", s)
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s).lower()