Skip to content

Commit a091cbc

Browse files
committed
Remove stringcase
1 parent a8ad575 commit a091cbc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

dash/development/_py_prop_typing.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import string
44
import textwrap
55
import importlib
6-
7-
import stringcase
6+
import re
87

98

109
shapes = {}
@@ -52,9 +51,15 @@ def generate_any(*_):
5251
return "typing.Any"
5352

5453

54+
def pascal_case(name: str):
55+
return name[0].upper() + re.sub(
56+
r"[\-_\.\s]([a-z])", lambda match: match.group(1).upper(), name[1:]
57+
)
58+
59+
5560
def generate_shape(type_info, component_name: str, prop_name: str):
5661
props = []
57-
name = stringcase.pascalcase(prop_name)
62+
name = pascal_case(prop_name)
5863

5964
for prop_key, prop_type in type_info["value"].items():
6065
typed = get_prop_typing(

requirements/install.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ requests
77
retrying
88
nest-asyncio
99
setuptools
10-
stringcase>=1.2.0

0 commit comments

Comments
 (0)