|
|
|
@ -67,8 +67,12 @@ def _create_produc_place(folder: str)-> None:
|
|
|
|
for acte in os.listdir(folder):
|
|
|
|
for acte in os.listdir(folder):
|
|
|
|
if acte.endswith(".xml"):
|
|
|
|
if acte.endswith(".xml"):
|
|
|
|
soup = make_soup(os.path.join(folder, acte))
|
|
|
|
soup = make_soup(os.path.join(folder, acte))
|
|
|
|
|
|
|
|
# search for
|
|
|
|
|
|
|
|
# //body//div[@type='front']/docdate/placeName[@type='production_place']
|
|
|
|
|
|
|
|
# and add to list places_xtract
|
|
|
|
for place in soup.find('placeName', {'type': 'production_place'}):
|
|
|
|
for place in soup.find('placeName', {'type': 'production_place'}):
|
|
|
|
places_xtract.append(place)
|
|
|
|
places_xtract.append(place)
|
|
|
|
|
|
|
|
# made data list (production_places) by iterating on set(places_xtract)
|
|
|
|
production_places = [{"placename": xtraction} for xtraction in set(places_xtract)]
|
|
|
|
production_places = [{"placename": xtraction} for xtraction in set(places_xtract)]
|
|
|
|
for data in tqdm(production_places, desc="Populating Place..."):
|
|
|
|
for data in tqdm(production_places, desc="Populating Place..."):
|
|
|
|
Production_place.create(**data)
|
|
|
|
Production_place.create(**data)
|
|
|
|
|