If you are using this script on the dataverse installed server where the python package are available, you could run it on the terminal.
I have prepared this document to extract metadata from datasets using Python 3.14 on Windows 11. We are using the OAI protocol to harvest the metadata.
-
Install Python 3.14 on a Windows system https://www.python.org/downloads/windows/
-
Add a path to Python in Environmental Variables
Eg:-
D:\Python
D:\Python\Scripts\
- Verify Installation
Open Command Prompt and run:
python --version
Disable Microsoft Store Python Alias, if Windows keeps redirecting Python to the Microsoft Store
Open Settings
Go to Apps → Advanced app settings
Click App execution aliases
Turn OFF:
python.exe
python3.exe
- Restart Command Prompt and test again:
python --version
-
Install Required Python Package**
Now install the required library:
pip install requests -
Download and extract the zip file into a folder
7 . Edit the base URL under the heading # configuration
Eg. https://dataverse.harvard.edu/oai
Please don't remove the /oai from the Base URL.
Save the file as harvest_dataverse_oai_csv.py
-
Open the command prompt
-
Go to the folder where you saved the script
E.g.
cd C:\Users\koormath\Documents
If the file is somewhere else, you can locate it with:
dir harvest_dataverse_oai_csv.py
-
Run the script
python harvest_dataverse_oai_csv.py -
Output File
It will create an output file for all metadata from all datasets.
dataverse_oai_records.csv