{"id":34202072,"url":"https://github.com/patoroco/euribor","last_synced_at":"2026-03-12T17:31:45.554Z","repository":{"id":290999364,"uuid":"976253216","full_name":"patoroco/euribor","owner":"patoroco","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-10T10:25:57.000Z","size":541,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-10T17:43:17.091Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patoroco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-01T19:20:15.000Z","updated_at":"2026-03-10T10:26:01.000Z","dependencies_parsed_at":"2025-12-16T15:03:31.049Z","dependency_job_id":null,"html_url":"https://github.com/patoroco/euribor","commit_stats":null,"previous_names":["patoroco/euribor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patoroco/euribor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patoroco%2Feuribor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patoroco%2Feuribor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patoroco%2Feuribor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patoroco%2Feuribor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patoroco","download_url":"https://codeload.github.com/patoroco/euribor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patoroco%2Feuribor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30435164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-15T18:51:29.699Z","updated_at":"2026-03-12T17:31:45.545Z","avatar_url":"https://github.com/patoroco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EURIBOR Rates API\n\nThis project provides a simple API to access EURIBOR rates data. The data is automatically updated through GitHub Actions and served via GitHub Pages.\n\n## API Endpoints\n\n\u003e **Note about GitHub Pages**: This API is hosted on GitHub Pages, which automatically serves `index.json` files when a directory URL is accessed. This means you can omit `index.json` from all JSON endpoint URLs.\n\n### Yearly JSON with Monthly Averages\n\n- Format: `https://patoroco.github.io/euribor/api/{YYYY}`\n- Example: `https://patoroco.github.io/euribor/api/2024`\n- Returns: JSON object with monthly average EURIBOR rates for the specified year\n\nExample response:\n\n```json\n{\n  \"01\": {\n    \"value\": \"3.589\",\n    \"_meta\": {\n      \"full_date\": \"2024-01\",\n      \"last_modified\": \"2024-05-21T10:00:00\"\n    }\n  },\n  \"02\": {\n    \"value\": \"3.572\",\n    \"_meta\": {\n      \"full_date\": \"2024-02\",\n      \"last_modified\": \"2024-05-21T10:00:00\"\n    }\n  }\n  // ... other months\n}\n```\n\n### Monthly JSON with Daily Rates\n\n- Format: `https://patoroco.github.io/euribor/api/{YYYY}/{MM}`\n- Example: `https://patoroco.github.io/euribor/api/2024/12`\n- Returns: JSON object with daily EURIBOR rates for the specified month\n\n\u003e **Important**: The JSON includes entries for all days of the month. Days without data (weekends, holidays) have a `null` value while days with data have the actual rate as a string.\n\nExample response:\n\n```json\n{\n  \"01\": {\n    \"value\": \"3.585\",\n    \"_meta\": {\n      \"full_date\": \"2024-12-01\",\n      \"last_modified\": \"2024-12-01T10:00:00\"\n    }\n  },\n  \"02\": {\n    \"value\": \"3.590\",\n    \"_meta\": {\n      \"full_date\": \"2024-12-02\",\n      \"last_modified\": \"2024-12-02T10:00:00\"\n    }\n  },\n  \"03\": {\n    \"value\": null,\n    \"_meta\": {\n      \"full_date\": \"2024-12-03\",\n      \"last_modified\": \"2024-12-03T10:00:00\"\n    }\n  }\n  // ... other days\n}\n```\n\n## Data Source\n\nThe data is collected from [euribor-rates.eu](https://www.euribor-rates.eu/) and updated automatically through GitHub Actions.\n\n## Automatic Updates\n\nThe data is updated daily at 10:00 UTC using a GitHub Action workflow. The workflow:\n\n1. Fetches the latest EURIBOR rates from euribor-rates.eu\n2. Calculates monthly averages based on daily rates\n3. Generates and updates JSON files for both yearly (with monthly data) and monthly (with daily data)\n4. Commits and pushes changes to the repository\n\nOn the first run, the workflow will also populate historical data starting from 1999.\n\n## Directory Structure\n\n```\napi/\n├── 2024/\n│   ├── index.json  # JSON with all monthly averages for 2024 (accessible via /api/2024/)\n│   ├── 01/\n│   │   └── index.json  # JSON with all daily rates for January 2024 (accessible via /api/2024/01/)\n│   ├── 02/\n│   │   └── index.json  # JSON with all daily rates for February 2024 (accessible via /api/2024/02/)\n│   └── ...\n└── 2025/\n    └── ...\n```\n\nEach of the `index.json` files can be accessed through GitHub Pages by simply using the directory URL (without explicitly referencing the filename). For example, `https://patoroco.github.io/euribor/api/2024/` will serve the yearly JSON file for 2024.\n\n## Development\n\nThis project uses UV, an ultra-fast Python package manager, for dependency management and virtual environments.\n\n### Setting up the development environment\n\n1. **Install UV**:\n\n   ```bash\n   curl -fsSL https://astral.sh/uv/install.sh | bash\n   ```\n\n2. **Create virtual environment**:\n\n   ```bash\n   uv venv .venv\n   source .venv/bin/activate  # Linux/macOS\n   # or\n   # .venv\\Scripts\\activate  # Windows\n   ```\n\n3. **Install dependencies**:\n\n   ```bash\n   uv pip install -e \".[dev]\"  # Install package with development dependencies\n   ```\n\n4. **Run tests**:\n   ```bash\n   python -m pytest\n   ```\n\n### Running the Script\n\nThe script can be run with various options to control which years and months to process:\n\n```bash\n# Process current month (and previous month if in first week)\npython -m src.euribor\n\n# Process a specific year\npython -m src.euribor --year 2024\n\n# Process a specific month of the current year\npython -m src.euribor --month 5\n\n# Process a specific year and month\npython -m src.euribor --year 2024 --month 5\n\n# Process all historical years (1999 to current)\npython -m src.euribor --all\n```\n\nCommand line options:\n\n- `--year YEAR`: Process only the specified year\n- `--month MONTH`: Process only the specified month\n- `--all`: Process all years from 1999 to current\n- No arguments: Process the current month (and previous month if in first week of the month, or previous year's December if in January)\n\nProcessing only the current month significantly speeds up execution, especially for automation via GitHub Actions.\n\n#### Smart defaults for automation:\n\n- If running in January, it also processes December of the previous year\n- If running in the first week of a month, it also processes the previous month\n- This ensures that any late updates to the previous period are captured\n\nFor more information on UV, visit the [UV official website](https://astral.sh/uv).\n\n## Google Sheets Integration\n\nYou can easily integrate this API with Google Sheets using custom functions. Here's an example of the functions:\n\n```javascript\n/**\n * Fetches Euribor data from the JSON API\n *\n * @param {string} type - The type of data to fetch: \"monthly\" for yearly JSON or \"daily\" for monthly JSON\n * @param {string|Date} date - Date to fetch rate for (YYYY for yearly, YYYY-MM for monthly)\n * @param {string} key - The specific key to fetch (month number for yearly, day number for monthly)\n * @param {string} field - The field to return (defaults to \"value\")\n * @return {string} The Euribor rate or error message\n */\nfunction EURIBOR_JSON(type, date, key, field = \"value\") {\n  if (date === undefined) {\n    return \"UNDEFINED\";\n  }\n\n  let year, month;\n\n  if (typeof date === \"string\") {\n    // If already a string, split by common separators\n    const parts = date.split(/[-/\\.]/);\n    year = parts[0];\n    month = parts.length \u003e 1 ? parts[1].padStart(2, \"0\") : \"\";\n  } else if (date instanceof Date) {\n    // If it's a Date object, format it\n    year = date.getFullYear();\n    month = (date.getMonth() + 1).toString().padStart(2, \"0\");\n  } else {\n    return \"INVALID_DATE\";\n  }\n\n  // Prepare path for API call\n  let url;\n  if (type === \"monthly\") {\n    // Yearly JSON with monthly data\n    url = `https://patoroco.github.io/euribor/api/${year}`;\n  } else if (type === \"daily\") {\n    // Monthly JSON with daily data\n    if (!month) return \"MISSING_MONTH\";\n    url = `https://patoroco.github.io/euribor/api/${year}/${month}`;\n  } else {\n    return \"INVALID_TYPE\";\n  }\n\n  try {\n    const response = UrlFetchApp.fetch(url, { muteHttpExceptions: true });\n    const statusCode = response.getResponseCode();\n\n    if (statusCode !== 200) {\n      return \"NODATA\";\n    }\n\n    const jsonData = JSON.parse(response.getContentText());\n\n    // If no key specified, return the entire JSON\n    if (!key) {\n      return JSON.stringify(jsonData);\n    }\n\n    // Ensure key is padded with zeros if it's a number\n    const paddedKey = isNaN(key) ? key : key.toString().padStart(2, \"0\");\n\n    // Check if the key exists\n    if (!jsonData[paddedKey]) {\n      return \"KEY_NOT_FOUND\";\n    }\n\n    // Return the requested field\n    if (field === \"value\") {\n      return jsonData[paddedKey].value;\n    } else if (field.startsWith(\"_meta.\")) {\n      const metaField = field.split(\".\")[1];\n      return jsonData[paddedKey]._meta[metaField];\n    } else {\n      return \"INVALID_FIELD\";\n    }\n  } catch (error) {\n    return \"ERROR: \" + error.toString();\n  }\n}\n\n/**\n * Fetches a specific day's value from the monthly JSON\n *\n * @param {string|Date} yearMonth - Year and month (YYYY-MM, YYYY/MM, or Date object)\n * @param {string|number} day - The day to fetch (1-31)\n * @return {string} The daily Euribor rate\n */\nfunction EURIBOR_JSON_DAILY(yearMonth, day) {\n  return EURIBOR_JSON(\"daily\", yearMonth, day);\n}\n\n/**\n * Fetches a specific month's average from the yearly JSON\n *\n * @param {string|number} year - The year (YYYY)\n * @param {string|number} month - The month to fetch (1-12)\n * @return {string} The monthly average Euribor rate\n */\nfunction EURIBOR_JSON_MONTHLY(year, month) {\n  return EURIBOR_JSON(\"monthly\", year, month);\n}\n```\n\n### Usage in Google Sheets\n\n1. Open your Google Sheet\n2. Go to Extensions \u003e Apps Script\n3. Paste the code above\n4. Save and close the script editor\n5. In your sheet, you can now use:\n   - `=EURIBOR_JSON_DAILY(\"2024/12\", 27)` for daily rates from the JSON API\n   - `=EURIBOR_JSON_MONTHLY(2024, 12)` for monthly averages from the JSON API\n\n\u003e **Note**: The JSON functions use GitHub Pages' automatic index.json serving feature, making the URLs simpler and more intuitive.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Author\n\nJorge Maroto\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatoroco%2Feuribor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatoroco%2Feuribor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatoroco%2Feuribor/lists"}