libere-tes-chaine-de-mots/import_data/00_creer_reseauxsociaux.py
2024-07-18 20:04:51 -04:00

18 lines
452 B
Python

import requests
import utils.config
from utils.opensearch import opensearch_client
from utils.reseau_social_data import reseau_social_data as rs_data
# %%
rs_data
# %%
opensearch_client.info()
# %%
for rs in rs_data:
nom = rs.get("nom")
for repertoire in rs.get("repertoires", []):
index_name = f"rs_{nom}_{repertoire}".lower()
opensearch_client.indices.create(index=index_name)
print(f"Index '{index_name}' créé")