{"id":13942613,"url":"https://github.com/Hugoberry/PowerQueryDecompiler","last_synced_at":"2025-07-20T06:31:40.037Z","repository":{"id":114273927,"uuid":"125009889","full_name":"Hugoberry/PowerQueryDecompiler","owner":"Hugoberry","description":"Decompiler for Power Query code","archived":false,"fork":false,"pushed_at":"2018-03-29T18:44:31.000Z","size":47,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-27T12:36:48.182Z","etag":null,"topics":["powerbi","powerquery"],"latest_commit_sha":null,"homepage":null,"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/Hugoberry.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}},"created_at":"2018-03-13T07:27:11.000Z","updated_at":"2024-10-13T15:49:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"29a13018-3c68-48c9-8f0c-445969be8d02","html_url":"https://github.com/Hugoberry/PowerQueryDecompiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Hugoberry/PowerQueryDecompiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hugoberry%2FPowerQueryDecompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hugoberry%2FPowerQueryDecompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hugoberry%2FPowerQueryDecompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hugoberry%2FPowerQueryDecompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hugoberry","download_url":"https://codeload.github.com/Hugoberry/PowerQueryDecompiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hugoberry%2FPowerQueryDecompiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266076350,"owners_count":23872741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["powerbi","powerquery"],"created_at":"2024-08-08T02:01:57.324Z","updated_at":"2025-07-20T06:31:39.773Z","avatar_url":"https://github.com/Hugoberry.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# Power Query Decompiler\nThis repository contains a proof of concept on decompiling Power Query (M) functions.\n![Output](img/DecompileCall.PNG)\n\n## Structure\n\n`AST.pq` - a deep call to `Value.ResourceExpression` in order to demo how the Abstract Syntax Tree (AST) looks for  `List.Range` \n```\n=Value.ResourceExpression(List.Range)\n    [Expression]\n        [Arguments]{0}\n            [Function]\n                [Expression]\n                    [Expression]\n```\n\n`AST2json.pq` - serializing the output from `Value.ResourceExpression` to `JSON` \n\n`Decompile.pq` - function definition that translates an AST into an expression\n\n`Expression.pq` - same code as `Decompile(x)` function exposed as an expression(query)\n\n## Functions that are \"decompilable\"\n\nThe query that would return the list of functions that should deompile is:\n```\n= List.Select(Record.FieldNames(#shared),each Value.ResourceExpression(Record.Field(#shared,_))[Kind]=\"Function\")\n```\nWhich brings up this output:\n\n`Date.DayOfWeekName` , `Date.IsInCurrentDay` , `Date.IsInCurrentMonth` , `Date.IsInCurrentQuarter` , `Date.IsInCurrentWeek` , `Date.IsInCurrentYear` , `Date.IsInNextDay` , `Date.IsInNextMonth` , `Date.IsInNextNDays` , `Date.IsInNextNMonths` , `Date.IsInNextNQuarters` , `Date.IsInNextNWeeks` , `Date.IsInNextNYears` , `Date.IsInNextQuarter` , `Date.IsInNextWeek` , `Date.IsInNextYear` , `Date.IsInPreviousDay` , `Date.IsInPreviousMonth` , `Date.IsInPreviousNDays` , `Date.IsInPreviousNMonths` , `Date.IsInPreviousNQuarters` , `Date.IsInPreviousNWeeks` , `Date.IsInPreviousNYears` , `Date.IsInPreviousQuarter` , `Date.IsInPreviousWeek` , `Date.IsInPreviousYear` , `Date.IsInYearToDate` , `Date.MonthName` , `DateTime.IsInCurrentHour` , `DateTime.IsInCurrentMinute` , `DateTime.IsInCurrentSecond` , `DateTime.IsInNextHour` , `DateTime.IsInNextMinute` , `DateTime.IsInNextNHours` , `DateTime.IsInNextNMinutes` , `DateTime.IsInNextNSeconds` , `DateTime.IsInNextSecond` , `DateTime.IsInPreviousHour` , `DateTime.IsInPreviousMinute` , `DateTime.IsInPreviousNHours` , `DateTime.IsInPreviousNMinutes` , `DateTime.IsInPreviousNSeconds` , `DateTime.IsInPreviousSecond` , `List.FindText` , `List.MatchesAll` , `List.MatchesAny` , `List.NonNullCount` , `List.Range` , `List.RemoveItems` , `List.RemoveLastN` , `List.ReplaceValue` , `Replacer.ReplaceValue` , `SqlExpression.SchemaFrom` , `Table.AddColumn` , `Table.AlternateRows` , `Table.Buffer` , `Table.ColumnCount` , `Table.ColumnsOfType` , `Table.CombineColumns` , `Table.Contains` , `Table.ContainsAll` , `Table.ContainsAny` , `Table.DemoteHeaders` , `Table.DuplicateColumn` , `Table.ExpandListColumn` , `Table.ExpandTableColumn` , `Table.FillUp` , `Table.FindText` , `Table.FirstValue` , `Table.HasColumns` , `Table.InsertRows` , `Table.IsDistinct` , `Table.IsEmpty` , `Table.Last` , `Table.LastN` , `Table.MatchesAllRows` , `Table.MatchesAnyRows` , `Table.Max` , `Table.MaxN` , `Table.Min` , `Table.MinN` , `Table.Partition` , `Table.PositionOf` , `Table.PositionOfAny` , `Table.PrefixColumns` , `Table.Profile` , `Table.Range` , `Table.RemoveLastN` , `Table.RemoveMatchingRows` , `Table.RemoveRows` , `Table.Repeat` , `Table.ReplaceMatchingRows` , `Table.ReplaceRows` , `Table.ReplaceValue` , `Table.ReverseRows` , `Table.Schema` , `Table.SplitColumn` , `Table.ToColumns` , `Table.ToRows` , `Table.TransformRows` , `Table.Transpose` , `Table.View` , `Text.AfterDelimiter` , `Text.BeforeDelimiter` , `Text.BetweenDelimiters` , `Text.Format` , `Type.TableSchema`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHugoberry%2FPowerQueryDecompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHugoberry%2FPowerQueryDecompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHugoberry%2FPowerQueryDecompiler/lists"}