Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pathlib into the update_data.py file #172

Closed
wants to merge 12 commits into from
11 changes: 8 additions & 3 deletions src/scribe_data/wikidata/update_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

import json
import os
from pathlib import Path
from urllib.error import HTTPError

from tqdm.auto import tqdm
Expand All @@ -42,11 +43,15 @@


def update_data(languages=None, word_types=None):
SCRIBE_DATA_SRC_PATH = "src/scribe_data"
p = Path("/src")
q = p / 'scribe_data'
lan = q / 'language_data_extraction'
# SCRIBE_DATA_SRC_PATH = "src/scribe_data"
PATH_TO_LANGUAGE_EXTRACTION_FILES = (
f"{SCRIBE_DATA_SRC_PATH}/language_data_extraction"
lan.resolve()
)
PATH_TO_UPDATE_FILES = f"{SCRIBE_DATA_SRC_PATH}/load/update_files"
PATH_TO_UPDATE_FILES = q / 'load' / 'update_files'
PATH_TO_UPDATE_FILES.resolve()

with open(f"{PATH_TO_UPDATE_FILES}/total_data.json", encoding="utf-8") as f:
current_data = json.load(f)
Expand Down
Loading