Download url_script.py from mehdie/sefaria: direct link, hf CLI and curl.
- Browser
- Download file 655 Bytes
-
https://huggingface.co/datasets/mehdie/sefaria/resolve/main/url_script.py
- Command line
-
hf download hf://datasets/mehdie/sefaria/url_script.py
-
curl -L -o url_script.py https://huggingface.co/datasets/mehdie/sefaria/resolve/main/url_script.py
655 Bytes
| import os | |
| base_url = "https://huggingface.co/datasets/mehdie/sefaria/raw/main/data/" | |
| local_data_dir = "data" | |
| english_files = [f for f in os.listdir(local_data_dir) if f.endswith("_english.parquet")] | |
| hebrew_files = [f for f in os.listdir(local_data_dir) if f.endswith("_hebrew.parquet")] | |
| english_urls = [os.path.join(base_url, f) for f in english_files] | |
| hebrew_urls = [os.path.join(base_url, f) for f in hebrew_files] | |
| all_urls = english_urls + hebrew_urls | |
| data_urls = { | |
| "english": english_urls, | |
| "hebrew": hebrew_urls, | |
| "all": all_urls, | |
| } | |
| print("English URLs:", english_urls) | |
| print("Hebrew URLs:", hebrew_urls) | |
| print("All URLs:", all_urls) | |