-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(requirements): internalize
inflection
- Loading branch information
1 parent
cb816df
commit 5654adc
Showing
4 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# https://pypi.org/project/inflection/ | ||
|
||
import re | ||
|
||
|
||
# from inflection/__init.py | ||
def underscore(word: str) -> str: | ||
word = re.sub(r"([A-Z]+)([A-Z][a-z])", r'\1_\2', word) | ||
word = re.sub(r"([a-z\d])([A-Z])", r'\1_\2', word) | ||
word = word.replace("-", "_") | ||
return word.lower() | ||
|
||
|
||
# from inflection/__init.py | ||
def camelize(string: str, uppercase_first_letter: bool = True) -> str: | ||
if uppercase_first_letter: | ||
return re.sub(r"(?:^|_)(.)", lambda m: m.group(1).upper(), string) | ||
else: | ||
return string[0].lower() + camelize(string)[1:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ coloredlogs | |
dataclasses_json | ||
gitignorefile | ||
importlib_metadata | ||
inflection | ||
inquirer | ||
joblib | ||
networkx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ click | |
dataclasses_json | ||
|
||
|
||
inflection | ||
|
||
joblib | ||
|
||
|