aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/utils.py
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-24 20:28:08 -0500
committermat <github@matdoes.dev>2022-05-24 20:28:08 -0500
commit0a314bca16f6de199c319ffb0d84a5d5c3a61387 (patch)
treeaf5293d0eafb86e12653719b2af0c3f36e8f5663 /codegen/lib/utils.py
parent04aea6afaf6819a66181d5d544356764d118b1bb (diff)
downloadazalea-drasl-0a314bca16f6de199c319ffb0d84a5d5c3a61387.tar.xz
rename code-generator to codegen
Diffstat (limited to 'codegen/lib/utils.py')
-rw-r--r--codegen/lib/utils.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/codegen/lib/utils.py b/codegen/lib/utils.py
new file mode 100644
index 00000000..5336d574
--- /dev/null
+++ b/codegen/lib/utils.py
@@ -0,0 +1,15 @@
+import urllib.request
+import gzip
+import json
+import re
+import io
+
+
+def to_snake_case(name):
+ s = re.sub('([A-Z])', r'_\1', name)
+ return s.lower().strip('_')
+
+
+def to_camel_case(name):
+ s = re.sub('_([a-z])', lambda m: m.group(1).upper(), name)
+ return s[0].upper() + s[1:]