kemmlowww/tg-storage / bot /sysinfo.py
kemmlowww's picture
download
raw
489 Bytes
from dataclasses import dataclass
import psutil
from . import DL_FOLDER, util
@dataclass
class Usage:
capacity: str
used: str
free: str
percent: str
def diskUsage(folder: str = DL_FOLDER) -> Usage:
usage = psutil.disk_usage(folder)
return Usage(
used=util.humanReadableSize(usage.used),
capacity=util.humanReadableSize(usage.total),
free=util.humanReadableSize(usage.total - usage.used),
percent=f"{usage.percent:.0f}%",
)

Xet Storage Details

Size:
489 Bytes
·
Xet hash:
ae345501c51e30df4a0e81461efc121b18bd8831f0707204bc2bfe572aa855df

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.