{"id":28177990,"url":"https://github.com/rabestro/exercism-api-powerquery-m","last_synced_at":"2026-01-23T07:36:56.942Z","repository":{"id":292406161,"uuid":"980808668","full_name":"rabestro/exercism-api-powerquery-m","owner":"rabestro","description":"A collection of Power Query M scripts to interact with the Exercism.org API (v2), simplifying data extraction for tracks and exercises.","archived":false,"fork":false,"pushed_at":"2025-07-26T13:20:36.000Z","size":20585,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-26T19:29:06.704Z","etag":null,"topics":["api-client","excel","exercism","exercism-tooling","m-language","power-bi","powerquery","powerquerym"],"latest_commit_sha":null,"homepage":"https://exercism.org/tracks","language":null,"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/rabestro.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}},"created_at":"2025-05-09T18:49:55.000Z","updated_at":"2025-07-26T13:20:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"76005be8-8eee-4409-b519-0d3ab5098a22","html_url":"https://github.com/rabestro/exercism-api-powerquery-m","commit_stats":null,"previous_names":["rabestro/exercism-api-powerquery-m"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rabestro/exercism-api-powerquery-m","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fexercism-api-powerquery-m","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fexercism-api-powerquery-m/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fexercism-api-powerquery-m/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fexercism-api-powerquery-m/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rabestro","download_url":"https://codeload.github.com/rabestro/exercism-api-powerquery-m/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fexercism-api-powerquery-m/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28683672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"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":["api-client","excel","exercism","exercism-tooling","m-language","power-bi","powerquery","powerquerym"],"created_at":"2025-05-16T01:11:20.358Z","updated_at":"2026-01-23T07:36:56.932Z","avatar_url":"https://github.com/rabestro.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# Power Query M for Exercism API\n\nWelcome! This repository provides Power Query M scripts to easily fetch data directly from the [Exercism.org API](https://exercism.org/docs/api/v2). This allows you to pull information about language tracks and their exercises into environments like Excel or Power BI for analysis, reporting, or track maintenance.\n\n## Overview\n\nThis collection currently focuses on the following core scripts:\n\n1.  **`ExercismAPIToken.pq`**: A parameter query to securely store your Exercism API token.\n2.  **`ExercismTracks.pq`**: A query that retrieves a comprehensive list of all language tracks available on Exercism.\n3.  **`GetTrackExercises.pq`**: A function that fetches all exercises for a specified language track.\n\nThese scripts are designed to be robust, including basic error handling for API connectivity and JSON parsing. Both `ExercismTracks.pq` and `GetTrackExercises.pq` can optionally use the `ExercismAPIToken` for authenticated API requests.\n\n## Available Scripts\n\n### 1. `ExercismAPIToken.pq` (Parameter)\n\n* **File:** [`powerquery/ExercismAPIToken.pq`](src/exercism-api/ExercismAPIToken.pq)\n* **Type:** Parameter Query\n* **Description:** Defines a Power Query parameter to securely store your personal Exercism API token. This allows other queries to make authenticated requests to the Exercism API.\n* **How to Obtain Your Token:**\n  1.  Log in to [Exercism.org](https://exercism.org).\n  2.  Click the three-dot menu (top right) -\u003e \"Settings\".\n  3.  Select \"API / CLI Token\" and copy your token.\n* **Usage:**\n  1.  Import `ExercismAPIToken.pq` into Power Query (see Setup).\n  2.  Rename the imported query to `ExercismAPIToken`.\n  3.  Edit the query and replace the placeholder `\"put your Exercism API Token here\"` with your actual token.\n\n### 2. `ExercismTracks.pq` (Query)\n\n* **File:** [`powerquery/ExercismTracks.pq`](src/exercism-api/ExercismTracks.pq)\n* **Type:** Query (Self-executing when loaded)\n* **Description:** Fetches a list of all language tracks from the Exercism API. If the `ExercismAPIToken` parameter is set, it will be used for authentication.\n* **Output Columns:**\n  * `slug` (text): The unique identifier for the track (e.g., \"csharp\", \"awk\").\n  * `Title` (text): The display name of the track.\n  * `HasCourse` (logical): `true` if the track is structured as a course.\n  * `ConceptsCount` (Int64.Type): The number of concepts in the track.\n  * `ExercisesCount` (Int64.Type): The number of exercises in the track.\n  * `WebURL` (text): The direct URL to the track page.\n  * `TagsList` (text): A comma-separated string of tags.\n* **Usage:**\n  1.  Optionally, set up the `ExercismAPIToken` parameter first.\n  2.  Import `ExercismTracks.pq` into Power Query.\n  3.  Rename the query to `ExercismTracks`. It will execute automatically.\n\n### 3. `GetTrackExercises.pq` (Function)\n\n* **File:** [`powerquery/GetTrackExercises.pq`](src/exercism-api/GetTrackExercises.pq)\n* **Type:** Function\n* **Description:** Fetches a list of exercises for a *specific* language track. If the `ExercismAPIToken` parameter is set, it will be used for authentication, which can provide user-specific data for fields like `IsUnlocked` and `IsRecommended`.\n* **Parameter:**\n  * `trackName` (text): The slug of the track (e.g., `\"bash\"`, `\"awk\"`).\n* **Output Columns:**\n  * `slug` (text): The exercise's unique identifier.\n  * `Type` (text): The type of exercise.\n  * `Title` (text): The exercise's title.\n  * `Difficulty` (text): The exercise's difficulty level.\n  * `Blurb` (text): A short description.\n  * `IsExternal` (logical): If the exercise is external.\n  * `IsUnlocked` (logical): If the exercise is unlocked (reflects user state if authenticated).\n  * `IsRecommended` (logical): If the exercise is recommended (reflects user state if authenticated).\n* **Usage:**\n  1.  Optionally, set up the `ExercismAPIToken` parameter.\n  2.  Import `GetTrackExercises.pq` and rename the query to `GetTrackExercises`.\n  3.  In a new query, invoke the function: `GetTrackExercises(\"your-track-slug\")`.\n\n  ![Example: AWK Exercises fetched using the GetTrackExercises function](assets/exercises-awk.png)\n\n## Prerequisites\n\n* A Power Query compatible environment:\n  * Microsoft Excel (Windows or Mac)\n  * Power BI Desktop\n  * Power Query Online (Dataflows)\n* Internet connectivity to reach the Exercism API (`https://exercism.org`).\n\n## Setup \u0026 Installation\n\n1.  **Download:** Clone this repository or download the individual `.pq` files from the [`src/`](src/) directory.\n2.  **Import into Power Query:**\n  * Open your Power Query Editor.\n    * **Excel**: `Data` tab -\u003e `Get Data` -\u003e `Launch Power Query Editor...`.\n    * **Power BI Desktop**: `Home` tab -\u003e `Transform data`.\n  * In the Power Query Editor, create a new query:\n    * Right-click in the Queries pane -\u003e `New Query` -\u003e `Other Sources` -\u003e `Blank Query`.\n  * With the new blank query selected, click `Advanced Editor` on the `Home` tab.\n  * Open the downloaded `.pq` file (e.g., `ExercismAPIToken.pq`) in a text editor.\n  * Copy the entire M code from the `.pq` file.\n  * Paste it into the Advanced Editor, replacing any existing content.\n  * Click `Done`.\n  * **Rename the query** to match the intended name (e.g., \"ExercismAPIToken\", \"ExercismTracks\", \"GetTrackExercises\"). This is crucial for them to work together correctly.\n\nRepeat the import process for each `.pq` file. It's recommended to set up `ExercismAPIToken.pq` first if you plan to use authenticated requests.\n\n## Advanced Usage Example\n\nFor a practical example of how to use the `GetTrackExercises` function to compare tracks (e.g., finding BASH exercises not yet in AWK), see:\n[`HOW_TO_USE.md`](HOW_TO_USE.md)\n*(This guide primarily uses `GetTrackExercises.pq`)*\n\n## Notes \u0026 Troubleshooting\n\n* **Authenticated vs. Anonymous Requests:** If `ExercismAPIToken` is not set up or empty, API calls will be anonymous. This might affect the data returned for user-specific fields like `IsUnlocked` or `IsRecommended` in the `GetTrackExercises` function.\n* **API Rate Limits:** Be mindful of potential API rate limits. Using an API token might provide higher limits.\n* **API Changes:** The data returned depends on the Exercism API (v2). Future API changes might require script updates.\n* **Error Handling:** The scripts include basic error handling. Check your internet and API status if issues persist.\n\n## Contributing\n\nContributions, issues, and feature requests are welcome!\n* Open an issue to report a bug or suggest an improvement.\n* Fork the repository and submit a pull request.\n\n## License\n\nThis project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabestro%2Fexercism-api-powerquery-m","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frabestro%2Fexercism-api-powerquery-m","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabestro%2Fexercism-api-powerquery-m/lists"}