mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 20:51:25 +03:00
refactor(chart): Move functions to separate files or folders to improve code structure.
This commit is contained in:
parent
110effaeb2
commit
85acbbb16c
5 changed files with 177 additions and 175 deletions
11
chart/function/gen_unique_name.py
Normal file
11
chart/function/gen_unique_name.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import datetime
|
||||
import random
|
||||
import string
|
||||
|
||||
|
||||
async def generate_unique_name(currency_pair: str, date: datetime) -> str:
|
||||
date_str = date.strftime("%Y%m%d")
|
||||
random_suffix = ''.join(random.choices(string.ascii_uppercase + string.digits, k=6))
|
||||
unique_name = f"{currency_pair}_{date_str}_{random_suffix}"
|
||||
|
||||
return unique_name
|
Loading…
Add table
Reference in a new issue