mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-14 04:10:30 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be260b0ee6 | ||
|
|
b0f2815568 | ||
|
|
6ac609f3f4 |
@@ -1,5 +1,7 @@
|
|||||||
import secrets
|
import secrets
|
||||||
import string
|
import string
|
||||||
|
import csv
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def create_random_password(length: int = 12) -> str:
|
def create_random_password(length: int = 12) -> str:
|
||||||
@@ -14,3 +16,11 @@ def create_random_password(length: int = 12) -> str:
|
|||||||
password += [secrets.choice(all_characters) for _ in range(length - 4)]
|
password += [secrets.choice(all_characters) for _ in range(length - 4)]
|
||||||
secrets.SystemRandom().shuffle(password)
|
secrets.SystemRandom().shuffle(password)
|
||||||
return "".join(password)
|
return "".join(password)
|
||||||
|
|
||||||
|
|
||||||
|
def data_to_csv(file: Path, data: list) -> None:
|
||||||
|
|
||||||
|
with file.open(mode="w", newline="", encoding="utf-8") as f:
|
||||||
|
writer = csv.DictWriter(f, fieldnames=data[0].keys(), delimiter=";")
|
||||||
|
writer.writeheader()
|
||||||
|
writer.writerows(data)
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
stripe==11.5.0 # Stripe
|
stripe==11.6.0 # Stripe
|
||||||
|
|||||||
Reference in New Issue
Block a user