{"id":19520053,"url":"https://github.com/malloydata/patterns","last_synced_at":"2026-02-07T18:05:45.574Z","repository":{"id":163085987,"uuid":"611360072","full_name":"malloydata/patterns","owner":"malloydata","description":"Malloy Design Patterns in Notebooks","archived":false,"fork":false,"pushed_at":"2023-09-13T14:25:46.000Z","size":10830,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-08T21:55:54.444Z","etag":null,"topics":[],"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/malloydata.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}},"created_at":"2023-03-08T17:01:54.000Z","updated_at":"2025-11-02T17:57:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"e579f5ac-5b8b-452b-b951-d068a277b1c1","html_url":"https://github.com/malloydata/patterns","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/malloydata/patterns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malloydata%2Fpatterns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malloydata%2Fpatterns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malloydata%2Fpatterns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malloydata%2Fpatterns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malloydata","download_url":"https://codeload.github.com/malloydata/patterns/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malloydata%2Fpatterns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29203083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T17:44:10.191Z","status":"ssl_error","status_checked_at":"2026-02-07T17:44:07.936Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":"2024-11-11T00:23:31.368Z","updated_at":"2026-02-07T18:05:45.515Z","avatar_url":"https://github.com/malloydata.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Malloy Design Patterns\n\nTo run these examples\n* Log into Github\n* press `.`  (the period key) to run vscode\n* Install the Malloy Extension when prompted (or manually)\n\n## Tables and Charts with 'OTHER'\nOften you want to limit the results to the top reusults.  This example shows how to bucket everything else into an 'OTHER' bucket\n\n[Other Buckets](other.malloynb)\n\n## A Simple Growth Calculation\nGrowth is this period minus last period divided by last period.  Here is how you do it simply in Malloy\n\n[Compute Growth](growth.malloynb)\n\n## Row Totals in Malloy\nMalloy currently doesn't support rendering tables with totals, but you can simple compute them.\n\n[Row Totals](totals.malloynb)\n\n## Level of Detail Calculations (ungrouped aggregates)\nMalloy has the ability to escape grouping in a query.  This is very useful for percent_of_total calculations among other things.\n\n[Level of Detail Calculations](level_of_detail.malloynb)\n\n## Working with Nested Data\nMalloy natively understands how to work with tables that have nested structs \nand arrays (including raw JSON) and makes easy to query and transform. \n\n[Nested Data](nested_data.malloynb)\n\n## Sessionization\nTake list of individual flights and map/reduce into individual aircraft sessions per day.  Display their routes for each day on a map.  Classic Map/Reduce.\n\n[Flight Route Sessinization](flight_routes.malloynb)\n\n## Automatic Historgrams\n\nWhen drawing an histogram, you need to figure out a proper bin size to group the data.  This pattern dyamically computes bin sizing.  The binning automatically adusts with in filtered and nesting situations.\n\n[Automatic Historgrams](auto_bin.malloynb)\n\n## Deduping Rows of Data (or basing a query on SQL)\n\nSometime data comes in with duplicates.  We can base a query on a SQL Query to remove duplicates\n\n[Dedup Rows](dedup_rows.malloynb)\n\n## Querying Data directly from a Web API\n\nUsing DuckDB wwe can query from Web API endpoints.  This example pulls from the github and runs some transformation queries against the results\n\n[HTTP API Queries](api_json.malloynb)\n\n## Indexing the entire source graph\nMalloy has a special 'index' operator that produces a result that contains all the dimensional values in a graph weighed by whatever measure \nyou think is important.  The index can be built by reading the whole graph or sampling a subset of records.  The index is useful \nin suggesting filters and for basic understanding of a data set and perhaps informing an LLM.\n\n[Malloy Dimensional Indexes](index.malloynb)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalloydata%2Fpatterns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalloydata%2Fpatterns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalloydata%2Fpatterns/lists"}