-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick_start.sh
More file actions
executable file
·53 lines (44 loc) · 1.4 KB
/
Copy pathquick_start.sh
File metadata and controls
executable file
·53 lines (44 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Quick start script for bulk updates
# Usage: ./quick_start.sh
set -e
echo "==================================================="
echo "Dataverse Bulk Metadata Update - Quick Start"
echo "==================================================="
echo ""
# Check if venv exists
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
# Activate venv
echo "Activating virtual environment..."
source venv/bin/activate
# Install dependencies
echo "Installing dependencies..."
pip install --quiet --upgrade pip
pip install --quiet requests
# Create directories
echo "Creating data directories..."
mkdir -p data/json_templates data/json_output backups logs
# Check for sample JSON files
if [ ! -f "data/json_templates/climate_data_2024.json" ]; then
echo "Note: No JSON files found in data/json_templates/"
echo "Please add your JSON files before proceeding"
echo ""
fi
# Convert JSON to CSV
echo ""
echo "Step 1: Converting JSON to CSV..."
python json_to_csv.py \
--input-dir ./data/json_templates \
--output-csv ./data/metadata.csv
echo ""
echo "✓ CSV created: data/metadata.csv"
echo ""
echo "Next steps:"
echo "1. Edit data/metadata.csv with new descriptions"
echo "2. Run: python csv_to_json.py --csv-file ./data/metadata.csv"
echo "3. Run: python dataverse_api.py --csv-file ./data/metadata.csv"
echo ""
echo "See WORKFLOW.md for detailed instructions"