# imkef/m architecture

> Architecture diagram of the GitHub repository imkef/m, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imkef/m
- Repository: https://github.com/imkef/m

## Overview

This repository is a collection of callable M functions for Power Query in Power BI, Excel, and Analysis Services—not a single application pipeline. A user runs a selected function in a supported host and receives a query result. The graph groups documented capabilities and shows only documented external interactions; source excerpts were unavailable, so internal call relationships are not inferred.

Main entry points: [`LibraryR/ImportPdfTextR.pq`](https://github.com/imkef/m/blob/master/LibraryR/ImportPdfTextR.pq) (PDF text import), [`Library/AccessingData.DropboxFolder.pq`](https://github.com/imkef/m/blob/master/Library/AccessingData.DropboxFolder.pq) (Dropbox folder), [`Library/GetCodeFromGithub.pq`](https://github.com/imkef/m/blob/master/Library/GetCodeFromGithub.pq) (Fetch GitHub code), [`Library/SQLFirstNRowsFromAllTables.pq`](https://github.com/imkef/m/blob/master/Library/SQLFirstNRowsFromAllTables.pq) (SQL table preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data_access["Data access"]
  node_dropbox_fn["Dropbox folder"]
  node_file_code["Read M code"]
  node_github_code["Fetch GitHub code"]
  node_sql_preview["SQL table preview"]
  node_http_token["API token"]
end

subgraph group_table_work["Table shaping"]
  node_table_ops["Table transforms"]
end

subgraph group_time_math["Dates and calculations"]
  node_date_ops["Date functions<br/>[Date.DimDate.pq]"]
  node_list_ops["List functions<br/>[List.Percentile.pq]"]
  node_number_ops["Number functions<br/>[Number.ModXls.pq]"]
  node_function_ops["Function utilities<br/>[Function.Pipe.pq]"]
end

subgraph group_code_text["Code and text"]
  node_code_serialization["M code serialization<br/>[Table.ToMCode.pq]"]
  node_text_ops["Text functions"]
end

subgraph group_r_excel["R and Excel"]
  node_excel_stats["Excel statistics<br/>[Xls.Binom.Dist.pq]"]
  node_pdf_import["PDF text import<br/>[ImportPdfTextR.pq]"]
  node_csv_export["CSV export"]
end

node_user(("Analyst"))
node_host["Power Query host"]
node_dropbox["Dropbox"]
node_github["GitHub"]
node_sql[("SQL database")]
node_r_runtime["R runtime"]
node_pdf["PDF file"]

node_user -->|"runs queries"| node_host
node_host -->|"invokes selected"| node_dropbox_fn
node_host -->|"invokes selected"| node_file_code
node_host -->|"invokes selected"| node_github_code
node_host -->|"invokes selected"| node_sql_preview
node_host -->|"invokes selected"| node_table_ops
node_host -->|"invokes selected"| node_date_ops
node_host -->|"invokes selected"| node_list_ops
node_host -->|"invokes selected"| node_number_ops
node_host -->|"invokes selected"| node_function_ops
node_host -->|"invokes selected"| node_http_token
node_host -->|"invokes selected"| node_code_serialization
node_host -->|"invokes selected"| node_text_ops
node_host -->|"invokes selected"| node_excel_stats
node_host -->|"invokes selected"| node_pdf_import
node_host -->|"invokes selected"| node_csv_export
node_dropbox_fn -->|"reads contents"| node_dropbox
node_github_code -->|"fetches code"| node_github
node_sql_preview -->|"reads rows"| node_sql
node_pdf_import -.->|"executes R"| node_r_runtime
node_pdf_import -->|"reads text"| node_pdf

click node_dropbox_fn "https://github.com/imkef/m/blob/master/Library/AccessingData.DropboxFolder.pq"
click node_file_code "https://github.com/imkef/m/blob/master/Library/AccessingData.MCodeFromFile.pq"
click node_github_code "https://github.com/imkef/m/blob/master/Library/GetCodeFromGithub.pq"
click node_sql_preview "https://github.com/imkef/m/blob/master/Library/SQLFirstNRowsFromAllTables.pq"
click node_table_ops "https://github.com/imkef/m/tree/master/Library"
click node_date_ops "https://github.com/imkef/m/blob/master/Library/Date.DimDate.pq"
click node_list_ops "https://github.com/imkef/m/blob/master/Library/List.Percentile.pq"
click node_number_ops "https://github.com/imkef/m/blob/master/Library/Number.ModXls.pq"
click node_function_ops "https://github.com/imkef/m/blob/master/Library/Function.Pipe.pq"
click node_http_token "https://github.com/imkef/m/blob/master/Library/Http.APIGenerateTokenPW.pq"
click node_code_serialization "https://github.com/imkef/m/blob/master/Library/Table.ToMCode.pq"
click node_text_ops "https://github.com/imkef/m/blob/master/Library/Text.RemoveHtmlTags.pq"
click node_excel_stats "https://github.com/imkef/m/blob/master/ExcelFunctions/Xls.Binom.Dist.pq"
click node_pdf_import "https://github.com/imkef/m/blob/master/LibraryR/ImportPdfTextR.pq"
click node_csv_export "https://github.com/imkef/m/blob/master/LibraryR/Table.ExportToCsv.pq"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dropbox_fn,node_file_code,node_github_code,node_sql_preview,node_http_token toneBlue
class node_table_ops,node_sql toneAmber
class node_date_ops,node_list_ops,node_number_ops,node_function_ops toneMint
class node_code_serialization,node_text_ops toneRose
class node_excel_stats,node_pdf_import,node_csv_export,node_user,node_host,node_dropbox,node_github,node_r_runtime,node_pdf toneIndigo
```

## Components

### Data access

- [Dropbox folder](https://github.com/imkef/m/blob/master/Library/AccessingData.DropboxFolder.pq): `Library/AccessingData.DropboxFolder.pq`
- [Read M code](https://github.com/imkef/m/blob/master/Library/AccessingData.MCodeFromFile.pq): `Library/AccessingData.MCodeFromFile.pq`
- [Fetch GitHub code](https://github.com/imkef/m/blob/master/Library/GetCodeFromGithub.pq): `Library/GetCodeFromGithub.pq`
- [SQL table preview](https://github.com/imkef/m/blob/master/Library/SQLFirstNRowsFromAllTables.pq): `Library/SQLFirstNRowsFromAllTables.pq`
- [API token](https://github.com/imkef/m/blob/master/Library/Http.APIGenerateTokenPW.pq): `Library/Http.APIGenerateTokenPW.pq`

### Table shaping

- [Table transforms](https://github.com/imkef/m/tree/master/Library): `Library`

### Dates and calculations

- [Date functions](https://github.com/imkef/m/blob/master/Library/Date.DimDate.pq): `Library/Date.DimDate.pq`
- [List functions](https://github.com/imkef/m/blob/master/Library/List.Percentile.pq): `Library/List.Percentile.pq`
- [Number functions](https://github.com/imkef/m/blob/master/Library/Number.ModXls.pq): `Library/Number.ModXls.pq`
- [Function utilities](https://github.com/imkef/m/blob/master/Library/Function.Pipe.pq): `Library/Function.Pipe.pq`

### Code and text

- [M code serialization](https://github.com/imkef/m/blob/master/Library/Table.ToMCode.pq): `Library/Table.ToMCode.pq`
- [Text functions](https://github.com/imkef/m/blob/master/Library/Text.RemoveHtmlTags.pq): `Library/Text.RemoveHtmlTags.pq`

### R and Excel

- [Excel statistics](https://github.com/imkef/m/blob/master/ExcelFunctions/Xls.Binom.Dist.pq): `ExcelFunctions/Xls.Binom.Dist.pq`
- [PDF text import](https://github.com/imkef/m/blob/master/LibraryR/ImportPdfTextR.pq): `LibraryR/ImportPdfTextR.pq`
- [CSV export](https://github.com/imkef/m/blob/master/LibraryR/Table.ExportToCsv.pq): `LibraryR/Table.ExportToCsv.pq`

### Other components

- **Analyst**
- **Power Query host**
- **Dropbox**
- **GitHub**
- **SQL database**
- **R runtime**
- **PDF file**

## Connections

- Analyst → Power Query host: runs queries
- Power Query host → Dropbox folder: invokes selected
- Power Query host → Read M code: invokes selected
- Power Query host → Fetch GitHub code: invokes selected
- Power Query host → SQL table preview: invokes selected
- Power Query host → Table transforms: invokes selected
- Power Query host → Date functions: invokes selected
- Power Query host → List functions: invokes selected
- Power Query host → Number functions: invokes selected
- Power Query host → Function utilities: invokes selected
- Power Query host → API token: invokes selected
- Power Query host → M code serialization: invokes selected
- Power Query host → Text functions: invokes selected
- Power Query host → Excel statistics: invokes selected
- Power Query host → PDF text import: invokes selected
- Power Query host → CSV export: invokes selected
- Dropbox folder → Dropbox: reads contents
- Fetch GitHub code → GitHub: fetches code
- SQL table preview → SQL database: reads rows
- PDF text import → R runtime: executes R
- PDF text import → PDF file: reads text
