import io
import tarfile
import base64


def get_tar_data(path):
    """Tar a path into a base64 string"""
    tardata = io.BytesIO()
    tar = tarfile.open(fileobj=tardata, mode="w")
    tar.add(path, arcname="./")
    return base64.b64encode(tardata.getvalue()).decode()