refactor: adjust structure

This commit is contained in:
Florian Hönicke
2023-03-18 20:05:52 +01:00
parent d84cc8ee04
commit 47aa456e88
10 changed files with 221 additions and 131 deletions

0
src/utils/__init__.py Normal file
View File

8
src/utils/io.py Normal file
View File

@@ -0,0 +1,8 @@
import os
import shutil
def recreate_folder(folder_path):
if os.path.exists(folder_path) and os.path.isdir(folder_path):
shutil.rmtree(folder_path)
os.makedirs(folder_path)

11
src/utils/string.py Normal file
View File

@@ -0,0 +1,11 @@
def find_between(input_string, start, end):
try:
start_index = input_string.index(start) + len(start)
end_index = input_string.index(end, start_index)
return input_string[start_index:end_index]
except ValueError:
raise ValueError(f'Could not find {start} and {end} in {input_string}')
def clean_content(content):
return content.replace('```', '').strip()