|
1 | | -# DataSetIQ Sheets Add-on (`datasetiq-sheets-addon`) |
| 1 | +# DataSetIQ Google Sheets Add-on |
2 | 2 |
|
3 | | -Google Sheets add-on that exposes DataSetIQ data through custom functions and a sidebar UI. |
| 3 | +**Professional Google Sheets add-on for economic and financial data from 15+ global sources.** |
4 | 4 |
|
5 | | -## Features |
6 | | -- Custom functions: `DSIQ` (spill array with headers, newest-first), `DSIQ_LATEST`, `DSIQ_VALUE` (on-or-before), `DSIQ_YOY`, `DSIQ_META`. |
7 | | -- User key stored in `PropertiesService` (user-scoped). Shared files never leak keys. |
8 | | -- Sidebar states for connect/disconnect, profile/quota display, and search via `/api/public/search`. |
9 | | -- First-run authorize menu (`Extensions > DataSetIQ > Authorize`) to enable `UrlFetchApp`. |
10 | | -- Single retry with exponential backoff for 429/5xx, respects `Retry-After` when provided. |
11 | | -- Date normalization to UTC `YYYY-MM-DD` for cache/API parity. |
| 5 | +## 📊 Features |
| 6 | + |
| 7 | +### Custom Functions |
| 8 | +- **`DSIQ(seriesId, [freq], [start])`** – Full time-series array with headers (newest-first) |
| 9 | +- **`DSIQ_LATEST(seriesId)`** – Most recent value only |
| 10 | +- **`DSIQ_VALUE(seriesId, date)`** – Value on or before specified date |
| 11 | +- **`DSIQ_YOY(seriesId)`** – Year-over-year growth rate |
| 12 | +- **`DSIQ_META(seriesId, field)`** – Metadata (title, units, frequency, etc.) |
| 13 | + |
| 14 | +### Premium Features 🔓 |
| 15 | + |
| 16 | +**Formula Builder Wizard** (🔧 Builder tab) |
| 17 | +- Step-by-step formula creation with guided inputs |
| 18 | +- Supports all DSIQ function types |
| 19 | +- Preview before inserting into cells |
| 20 | + |
| 21 | +**Templates System** (📁 Templates tab) |
| 22 | +- Scan current sheet for DSIQ formulas |
| 23 | +- Save formula collections as reusable templates |
| 24 | +- Load templates into new sheets instantly |
| 25 | +- Manage saved templates (view, load, delete) |
| 26 | + |
| 27 | +**Multi-Series Insert** (Search tab) |
| 28 | +- Select multiple series with checkboxes |
| 29 | +- Bulk insert with single click |
| 30 | +- Saves time on repetitive data pulls |
| 31 | + |
| 32 | +**Enhanced Sidebar UI** (🔍 Search tab) |
| 33 | +- Search across 15 data providers |
| 34 | +- Browse by source (FRED, BLS, IMF, OECD, etc.) |
| 35 | +- Favorites and Recent tracking |
| 36 | +- Live data preview with metadata |
| 37 | +- On-demand ingestion for metadata-only datasets |
| 38 | + |
| 39 | +### Data Sources (15 Providers) |
| 40 | +- **FRED** – Federal Reserve Economic Data |
| 41 | +- **BLS** – Bureau of Labor Statistics |
| 42 | +- **BEA** – Bureau of Economic Analysis |
| 43 | +- **Census** – US Census Bureau |
| 44 | +- **EIA** – Energy Information Administration |
| 45 | +- **IMF** – International Monetary Fund |
| 46 | +- **OECD** – Organisation for Economic Co-operation |
| 47 | +- **World Bank** – Global development data |
| 48 | +- **ECB** – European Central Bank |
| 49 | +- **Eurostat** – European statistics |
| 50 | +- **BOE** – Bank of England |
| 51 | +- **ONS** – UK Office for National Statistics |
| 52 | +- **StatCan** – Statistics Canada |
| 53 | +- **RBA** – Reserve Bank of Australia |
| 54 | +- **BOJ** – Bank of Japan |
| 55 | + |
| 56 | +## 🆓 Free vs 💎 Paid Plans |
| 57 | + |
| 58 | +| Feature | Free (No API Key) | Paid (Valid API Key) | |
| 59 | +|---------|------------------|----------------------| |
| 60 | +| **Custom Functions** | ✅ All functions | ✅ All functions | |
| 61 | +| **Observation Limit** | 100 most recent | 1,000 most recent | |
| 62 | +| **Search & Insert** | ✅ Basic search | ✅ Enhanced search | |
| 63 | +| **Data Preview** | ✅ Available | ✅ Available | |
| 64 | +| **Formula Builder** | ❌ Locked | ✅ Unlocked | |
| 65 | +| **Templates** | ❌ Locked | ✅ Unlocked | |
| 66 | +| **Multi-Insert** | ❌ Not available | ✅ Checkboxes visible | |
| 67 | +| **Favorites/Recent** | ✅ Available | ✅ Available | |
| 68 | +| **Browse by Source** | ✅ Available | ✅ Available | |
| 69 | + |
| 70 | +**Upgrade Message**: When data is truncated at 100 observations, users see: |
| 71 | +> ⚠️ Data limited to 100 most recent observations. Upgrade to a paid plan at datasetiq.com/pricing for up to 1,000 observations per series. |
| 72 | +
|
| 73 | +## 🚀 Getting Started |
| 74 | + |
| 75 | +### Installation |
| 76 | +1. Install from Google Workspace Marketplace |
| 77 | +2. Open Google Sheets → Extensions → DataSetIQ → Open Sidebar |
| 78 | +3. First-time: Extensions → DataSetIQ → Authorize (grants network permissions) |
| 79 | + |
| 80 | +### Connecting Your Account |
| 81 | +1. Visit [datasetiq.com/dashboard/api-keys](https://datasetiq.com/dashboard/api-keys) |
| 82 | +2. Create an API key (free or paid plan) |
| 83 | +3. In sidebar, enter your API key and click "Connect Account" |
| 84 | +4. Status shows: ✅ Connected - Premium features unlocked |
| 85 | + |
| 86 | +### Using Custom Functions |
| 87 | + |
| 88 | +**Basic Usage:** |
| 89 | +```javascript |
| 90 | +=DSIQ("FRED-GDP") |
| 91 | +// Returns full GDP time-series with Date/Value headers |
| 92 | + |
| 93 | +=DSIQ_LATEST("BLS-CPI") |
| 94 | +// Returns latest CPI value |
| 95 | + |
| 96 | +=DSIQ_VALUE("IMF-NGDP", "2023-12-31") |
| 97 | +// Returns GDP value on or before Dec 31, 2023 |
| 98 | + |
| 99 | +=DSIQ_YOY("FRED-UNRATE") |
| 100 | +// Returns year-over-year change in unemployment rate |
| 101 | +``` |
| 102 | + |
| 103 | +**Advanced Options:** |
| 104 | +```javascript |
| 105 | +=DSIQ("FRED-GDP", "quarterly", "2020-01-01") |
| 106 | +// GDP data, quarterly frequency, from 2020 onwards |
| 107 | + |
| 108 | +=DSIQ_META("FRED-GDP", "title") |
| 109 | +// Returns metadata field (title, units, frequency, updated, source) |
| 110 | +``` |
| 111 | + |
| 112 | +## 📖 User Guides |
| 113 | + |
| 114 | +### Formula Builder Wizard |
| 115 | + |
| 116 | +**Step 1: Choose Function** |
| 117 | +- Select from DSIQ, DSIQ_LATEST, DSIQ_VALUE, or DSIQ_YOY |
| 118 | +- Each function has different parameters |
| 119 | + |
| 120 | +**Step 2: Enter Series ID** |
| 121 | +- Enter the series identifier (e.g., "FRED-GDP") |
| 122 | +- Use Search tab to find series IDs |
| 123 | + |
| 124 | +**Step 3: Configure Options** (DSIQ and DSIQ_VALUE only) |
| 125 | +- **Frequency**: Optional (e.g., "quarterly", "monthly") |
| 126 | +- **Start Date**: Optional (e.g., "2020-01-01") |
| 127 | + |
| 128 | +**Step 4: Insert** |
| 129 | +- Click "Insert Formula" to place in active cell |
| 130 | +- Formula appears in cell and updates automatically |
| 131 | + |
| 132 | +### Templates Guide |
| 133 | + |
| 134 | +**Creating a Template:** |
| 135 | +1. Build your sheet with DSIQ formulas |
| 136 | +2. Click **🔧 Builder** tab → Navigate to Templates section |
| 137 | +3. Click "🔍 Scan Current Sheet" |
| 138 | +4. Review found formulas (count shown) |
| 139 | +5. Enter template name (e.g., "Q4 Report") |
| 140 | +6. Click "💾 Save Template" |
| 141 | + |
| 142 | +**Loading a Template:** |
| 143 | +1. Open new sheet |
| 144 | +2. Navigate to Templates tab |
| 145 | +3. Find saved template in list |
| 146 | +4. Click "📥 Load" button |
| 147 | +5. All formulas inserted at original cell positions |
| 148 | + |
| 149 | +**Managing Templates:** |
| 150 | +- **View**: See all saved templates with formula count |
| 151 | +- **Load**: Insert template into active sheet |
| 152 | +- **Delete**: Remove template (🗑️ button) |
| 153 | + |
| 154 | +### Multi-Series Insert |
| 155 | + |
| 156 | +**Selecting Series:** |
| 157 | +1. Search for series in Search tab |
| 158 | +2. Check boxes appear next to results (paid users only) |
| 159 | +3. Select multiple series by clicking checkboxes |
| 160 | +4. Counter updates: "Insert X Series" button appears |
| 161 | + |
| 162 | +**Bulk Insert:** |
| 163 | +1. Select active cell where you want first series |
| 164 | +2. Click "Insert X Series" button |
| 165 | +3. Series inserted vertically (one per row) |
| 166 | +4. Uses DSIQ_LATEST function by default |
| 167 | + |
| 168 | +## 🛠 Technical Details |
| 169 | + |
| 170 | +### Architecture |
| 171 | +- User API key stored in `PropertiesService` (user-scoped, never shared) |
| 172 | +- Sidebar UI communicates with `Code.gs` backend via `google.script.run` |
| 173 | +- Single retry with exponential backoff for 429/5xx errors |
| 174 | +- Respects `Retry-After` headers from API |
| 175 | +- Date normalization to UTC `YYYY-MM-DD` format |
| 176 | + |
| 177 | +### Privacy & Security |
| 178 | +- **No Key Leakage**: API keys stored per-user, never in spreadsheet |
| 179 | +- **Shared Files**: Each user must connect their own account |
| 180 | +- **Scopes**: Only requests necessary permissions (UrlFetchApp, Properties, Active Sheet) |
| 181 | + |
| 182 | +### Error Handling |
| 183 | +- **No API Key**: Sidebar shows "Connect your account" prompt |
| 184 | +- **Invalid Key**: "Invalid API Key. Please reconnect." |
| 185 | +- **Rate Limited**: "Rate limited. Please retry shortly." |
| 186 | +- **Free Limit**: "Free plan limit reached. Upgrade at datasetiq.com/pricing" |
| 187 | +- **Server Error**: "Server unavailable. Please retry." |
| 188 | + |
| 189 | +### Date Normalization |
| 190 | +- All dates normalized to UTC `YYYY-MM-DD` format |
| 191 | +- Handles MM/DD/YYYY, DD/MM/YYYY, ISO 8601, timestamps |
| 192 | +- Frequency and start date parameters also normalized |
12 | 193 |
|
13 | 194 | ## Scripts |
14 | 195 | - `npm run build` – bundle `src/Code.ts` to `Code.js` for `clasp push`. |
|
0 commit comments