Access the Storage information of a Repl?

Question:

Is it possible in Python to get the Storage of the Repl it runs on ?
Available space / Total space ?

Ghostwriter tells me about getstorage function but it doesn’t seem to exist anymore

Thanks

I think you can access the amount of storage your repl used at the bottom left corner at the status there is storage
Click it open and you can see the percentage of storage used corrected to 2 decimal places

If you want to access the informations in python
Use

import shutil
path = ‘/’ (root, or any path you want. Use /home/runner/{your project name, use - for spaces})
informations = shutil.disk_usage(path)
Print(informations)

You will get something like this

usage(total=244934381568, used=13350301696, free=219070689280)

They are shown in bytes btw

If you want to access the storage datas, JUST SURF IN THE FILES
Unless you did something actually not recommended, which may break the entire repl, then you may write something in the hidden file except the .tmol one feel free to edit

Hello,
thanks for your answer, yes I just want to have the amount of disk free of my Repl.

I have tried the shutil.disk_usage but it doesn’t work correctly, even when i use
path = “/home/runner/myrepl”

The disk free is far more than the 1GB shown in the Storage size.
I have tried “df -k .” in the console and it is the same, it doesn’t only include my repl’s stats