import os from huggingface_hub import HfApi SPACE_ID = "AhmedShahan/JobSathi_Backend" ENV_FILE = ".env" def main(): token = os.environ["HF_TOKEN"] api = HfApi(token=token) with open(ENV_FILE, "r") as f: for line in f: line = line.strip() if not line or line.startswith("#") or "=" not in line: continue key, value = line.split("=", 1) key = key.strip() value = value.strip().strip('"').strip("'") if not key: continue api.add_space_secret(repo_id=SPACE_ID, key=key, value=value) print(f"Synced: {key}") if __name__ == "__main__": main()