I think you can set the archive like so import os import subprocess def set_archive_flag(path): subprocess.run(["chflags", "arch", path])