various #16

Merged
dan merged 94 commits from various into dev 2023-12-14 14:04:01 +01:00
Showing only changes of commit a8479a56e3 - Show all commits

View file

@ -1,3 +1,5 @@
import random
import string
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
@ -35,3 +37,12 @@ def rmtree(root_dir: Path):
child.unlink()
root_dir.rmdir()
def generate_random_string(length: int, punctuation=False) -> str:
"""returns a random string of the given length"""
characters = string.ascii_letters + string.digits
if punctuation:
characters += string.punctuation
random_string = "".join(random.choice(characters) for _ in range(length))
return random_string