# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/05_user.ipynb.

# %% auto 0
__all__ = ['getuser', 'hideuser']

# %% ../nbs/05_user.ipynb 5
import os, pwd

# %% ../nbs/05_user.ipynb 7
from nchr import TILDE

# %% ../nbs/05_user.ipynb 9
#| export

# %% ../nbs/05_user.ipynb 11
def getuser() -> str:
    user = pwd.getpwuid(os.getuid())[0]
    return user

def hideuser(path: str) -> str:
    _, rest = path.split(getuser())
    return f'{TILDE}{rest}'
