This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def find_files(base, end_pattern, sub_name=None): | |
| ''' | |
| Searches for files with a specific name pattern | |
| in directories and subdirectories | |
| params: | |
| base : str | |
| strat directory | |
| end_pattern : list | |
| list of strings, patterns to find filenames | |
| sub_name : str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import googletrans | |
| from googletrans import * | |
| def text_to_en(text): | |
| translator = googletrans.Translator() | |
| translation = translator.translate(text, dest='en') | |
| return translation.text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import json | |
| def get_gnd_from_viaf(viafid): | |
| url = f'https://www.viaf.org/viaf/{viafid}/viaf.jsonld' | |
| response = requests.get(url) | |
| if response.status_code == 200: | |
| data = response.json() |