From 7963b12783610ea6ad6b97f3b95a80de3fd55b4e Mon Sep 17 00:00:00 2001 From: yujinKim Date: Sun, 31 Mar 2024 09:48:03 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20#1=20dummy=20data=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EA=B8=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openAPI/dummy_data_maker.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openAPI/dummy_data_maker.py b/openAPI/dummy_data_maker.py index a914c3c..050df02 100644 --- a/openAPI/dummy_data_maker.py +++ b/openAPI/dummy_data_maker.py @@ -2,12 +2,14 @@ import string from datetime import datetime + def generate_dummy_email(): domains = ["example.com", "test.com", "dummy.com"] username = ''.join(random.choices(string.ascii_lowercase + string.digits, k=7)) domain = random.choice(domains) return f"{username}@{domain}" + def preprocessing_book_index(book_index): dummy_book_indx = "

Dummy Book Index
1.example index
2.example index
3.example index

" if not book_index.strip(): @@ -15,22 +17,25 @@ def preprocessing_book_index(book_index): return book_index.replace("\r\n", "") + def generate_book_discount(): values = [0, 10, 20] weights = [5, 3, 2] # 각 값에 대한 가중치, 50%, 30%, 20%의 비율 return random.choices(values, weights=weights)[0] + def generate_book_package(): values = [0, 1] weights = [3, 7] # 각 값에 대한 가중치, 30%, 70%의 비율 return random.choices(values, weights=weights)[0] -def preprocessing_book_published(date): +def preprocessing_book_published(date): date_object = datetime.strptime(date, '%a, %d %b %Y %H:%M:%S %Z') return date_object.strftime('%Y-%m-%d') + def generate_book_stock(): values = [200, 300] weights = [5, 5] # 각 값에 대한 가중치, 30%, 70%의 비율