add BaseUrl

This commit is contained in:
Daniel 2023-12-04 19:35:54 +01:00
parent ae0c90cb8a
commit fb864659d8

View file

@ -1,5 +1,20 @@
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from urllib.parse import urlunparse
@dataclass
class BaseUrl:
netloc: str
scheme: str = "https"
path: str = ""
params: str = ""
query: str = ""
fragment: str = ""
def get(self, path: str = ""):
return urlunparse((self.scheme, self.netloc, path, self.params, self.query, self.fragment))
def get_session_id() -> str: