Get started in 5 minutes!
# Clone repository
git clone <repository-url>
cd Update_FileMetadata_Dataverse_multipleDOIs
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install requestsPlace your JSON files in data/json_templates/:
# Your JSON files should be like:
# data/json_templates/dataset1.json
# data/json_templates/dataset2.json
# data/json_templates/dataset3.jsonpython json_to_csv.py \
--input-dir ./data/json_templates \
--output-csv ./data/metadata.csvThis creates data/metadata.csv with all your file metadata.
Open data/metadata.csv in Excel or Google Sheets:
- Edit
new_descriptioncolumn with updated descriptions - Edit
new_file_pathcolumn if reorganizing files - Save the file
# Convert back to JSON
python csv_to_json.py --csv-file ./data/metadata.csvThis creates updated JSON files in data/json_output/.
# Set credentials
export DATAVERSE_SERVER_URL="https://your-dataverse.org"
export DATAVERSE_API_TOKEN="your-api-token"
# First, preview changes
python dataverse_api.py --csv-file ./data/metadata.csv
# Then apply changes
python dataverse_api.py --csv-file ./data/metadata.csv --no-dry-runYour metadata is now updated! For more details, see:
README.md- Complete documentationWORKFLOW.md- Detailed workflow guideINSTALLATION.md- Installation helpEXAMPLES.md- Practical examples
| Problem | Solution |
|---|---|
| "json not found" | Place JSON files in data/json_templates/ |
| Python errors | Run pip install requests |
| Dataverse connection fails | Check DATAVERSE_SERVER_URL and DATAVERSE_API_TOKEN |
| CSV issues | Ensure saved as UTF-8 encoding |
# JSON → CSV
python json_to_csv.py --input-dir ./data/json_templates
# CSV → JSON
python csv_to_json.py --csv-file ./data/metadata.csv
# Preview changes
python dataverse_api.py --csv-file ./data/metadata.csv
# Apply changes
python dataverse_api.py --csv-file ./data/metadata.csv --no-dry-run
# Get help
python json_to_csv.py --help
python csv_to_json.py --help
python dataverse_api.py --helpProject/
├── data/
│ ├── json_templates/ # Your JSON files (input)
│ ├── json_output/ # Generated JSON files (from CSV)
│ └── metadata.csv # Edit this file
├── json_to_csv.py # JSON → CSV
├── csv_to_json.py # CSV → JSON
├── dataverse_api.py # Dataverse API
├── README.md # Full documentation
└── WORKFLOW.md # Detailed workflow
Happy updating! 🎉