Dataset Viewer
Auto-converted to Parquet Duplicate
id
large_stringlengths
21
131
source
large_stringclasses
1 value
code
large_stringlengths
21
49.9k
file_path
large_stringlengths
10
108
repo_url
large_stringlengths
26
69
repo_owner
large_stringclasses
763 values
repo_name
large_stringlengths
2
34
repo_description
large_stringlengths
0
316
stars
int64
0
2.3k
is_official
bool
2 classes
license
large_stringclasses
9 values
license_raw
large_stringclasses
11 values
authors
large listlengths
1
1
hex_package
large_stringclasses
655 values
hex_downloads
int64
17
962k
fork
bool
1 class
archived
bool
2 classes
collected_at
large_stringlengths
32
32
commit_sha
large_stringlengths
40
40
schema_version
int64
1
1
JohnBjrk/showtime/src/showtime/internal/erlang/module_handler.gleam
github
@target(erlang) import gleam/otp/actor @target(erlang) import gleam/erlang/process @target(erlang) import showtime/internal/common/test_suite.{ type TestEventHandler, type TestFunctionCollector, type TestModule, type TestRunner, EndTestSuite, StartTestSuite, } @target(erlang) import showtime/internal/common/cli.{ty...
src/showtime/internal/erlang/module_handler.gleam
https://github.com/JohnBjrk/showtime
JohnBjrk
showtime
Gleam Testing Framework
26
false
Apache-2.0
Apache-2.0
[ "JohnBjrk" ]
showtime
2,912
false
false
2026-05-28T15:43:54.074472+00:00
b0c6dda03a6445e46fd538def5debdfe71d23f45
1
LilyRose2798/gleam-spacetraders-sdk/src/spacetraders_models/ship_registration.gleam
github
import gleam/dynamic/decode.{type Decoder} import spacetraders_models/faction_symbol.{type FactionSymbol} import spacetraders_models/ship_role.{type ShipRole} import spacetraders_models/ship_symbol.{type ShipSymbol} pub type ShipRegistration { ShipRegistration( name: ShipSymbol, faction_symbol: FactionSymbol...
src/spacetraders_models/ship_registration.gleam
https://github.com/LilyRose2798/gleam-spacetraders-sdk
LilyRose2798
gleam-spacetraders-sdk
A Gleam SDK for the spacetraders.io game API
0
false
MIT
MIT
[ "LilyRose2798" ]
null
null
false
false
2026-05-28T16:47:40.534251+00:00
e34dcfdb9367006c16d3567396b6b17cb2e8fb84
1
tetio/gleam/high-school-sweetheart/src/high_school_sweetheart.gleam
github
import gleam/list import gleam/result import gleam/string pub fn first_letter(name: String) { string.trim(name) |> string.first |> result.unwrap("") } pub fn initial(name: String) { first_letter(name) |> string.uppercase |> string.append(".") } pub fn initials(full_name: String) { string.split(full_...
high-school-sweetheart/src/high_school_sweetheart.gleam
https://github.com/tetio/gleam
tetio
gleam
0
false
Apache-2.0
Apache-2.0
[ "tetio" ]
gleam
1,923
false
false
2026-05-28T17:10:57.064335+00:00
0ce8660d0ba153de415040abb99c2ff9b6c87c84
1
ryanmiville/aws_api/src/aws_api/elasticsearch_service.gleam
github
import aws4_request.{type Signer} import aws_api/internal/endpoint import aws_api/internal/metadata.{Metadata} import aws_api/internal/request_builder import gleam/http.{type Header} import gleam/http/request.{type Request} import gleam/option.{type Option} import gleam/string const metadata = Metadata( endpoint_pre...
src/aws_api/elasticsearch_service.gleam
https://github.com/ryanmiville/aws_api
ryanmiville
aws_api
AWS request builder for Gleam
4
false
Apache-2.0
Apache-2.0
[ "ryanmiville" ]
null
null
false
false
2026-05-28T15:58:48.498925+00:00
b7cfd63cdcb45bd55c45f7cfdb4706510fa9efcc
1
y047aka/DeepSpaceNine-RTA-Chart/backend/src/backend.gleam
github
import fixtures/histograms import gleam/dynamic/decode import gleam/erlang/process import gleam/io import gleam/json import gleam/list import gleam/option.{Some} import gleam/otp/actor import gleam/string import mist import pog import types/episode.{type Episode} import types/histogram import wisp.{type Request, type R...
backend/src/backend.gleam
https://github.com/y047aka/DeepSpaceNine-RTA-Chart
y047aka
DeepSpaceNine-RTA-Chart
Star Trek: Deep Space Nine の最速視聴チャート
0
false
MIT
MIT
[ "y047aka" ]
null
null
false
false
2026-05-28T17:32:43.557861+00:00
64a3082d3f6a5547faecba0f708d36839a1f0ad0
1
andrea-berling/roach/src/types/instance.gleam
github
import gleam/dict import gleam/option import types.{type UUID} import types/topic.{type Topic, Topic} pub type FeatureLevels = dict.Dict(String, Int) pub type Instance { Instance( feature_levels: FeatureLevels, topics: dict.Dict(String, Topic), topic_ids_to_names: dict.Dict(UUID, String), server_p...
src/types/instance.gleam
https://github.com/andrea-berling/roach
andrea-berling
roach
🪳 Roach: A Kafka Broker written in Gleam
1
false
MIT
MIT
[ "andrea-berling" ]
null
null
false
false
2026-05-28T16:12:29.095554+00:00
51d574c24dfd8c5f2627cec22fba21299dabb01f
1
lustre-labs/lustre/examples/01-basics/01-hello-world/src/app.gleam
github
// IMPORTS --------------------------------------------------------------------- import gleam/int import lustre import lustre/element.{type Element} import lustre/element/html import lustre/event // MAIN ------------------------------------------------------------------------ pub fn main() { let app = lustre.simpl...
examples/01-basics/01-hello-world/src/app.gleam
https://github.com/lustre-labs/lustre
lustre-labs
lustre
A Gleam web framework for building HTML templates, single page applications, and real-time server components.
2,302
true
MIT
MIT
[ "lustre-labs" ]
lustre
245,785
false
false
2026-05-28T15:39:45.871015+00:00
c573707a57aef3542d84e7e18008cd38e62b9edf
1
emarifer/wisp_routing/src/utilities/tiny_database.gleam
github
import gleam/dict.{type Dict} import gleam/dynamic import gleam/json import gleam/list import gleam/result import simplifile import youid/uuid // La palabra clave `opaque` hace que el tipo sea público pero fuera // del módulo solo se puede construir el tipo utilizando un constructor // que realice algún tipo de restri...
src/utilities/tiny_database.gleam
https://github.com/emarifer/wisp_routing
emarifer
wisp_routing
A demo application of Gleam's Wisp framework with the addition of TailwindCss in the served HTML
0
false
MIT
MIT
[ "emarifer" ]
null
null
false
false
2026-05-28T17:14:01.045358+00:00
8a91a880e4ea609b976ed8c191467b70c0e043a2
1
bitbldr/sprocket/src/sprocket/internal/reconcilers/recursive.gleam
github
import gleam/dict import gleam/dynamic.{type Dynamic} import gleam/dynamic/decode import gleam/list import gleam/option.{type Option, None, Some} import sprocket/internal/context.{ type Attribute, type Context, type DynamicStatefulComponent, type Element, Attribute, ClientHook, ClientHookId, Component, ComponentWip...
src/sprocket/internal/reconcilers/recursive.gleam
https://github.com/bitbldr/sprocket
bitbldr
sprocket
A library for building server components in Gleam ✨
119
false
MIT
MIT
[ "bitbldr" ]
sprocket
3,662
false
false
2026-05-28T15:40:38.757117+00:00
4b510f6c8f3cef6f0a563ee31e36de91ed01161b
1
ghivert/redraw/redraw_dom/src/redraw/dom/server.gleam
github
import redraw.{type Element} /// Renders a React tree to an HTML string. /// /// [Documentation](https://react.dev/reference/react-dom/server/renderToString) @external(javascript, "react-dom/server", "renderToString") pub fn render_to_string(component: Element) -> String /// Renders a non-interactive React tree to an...
redraw_dom/src/redraw/dom/server.gleam
https://github.com/ghivert/redraw
ghivert
redraw
React bindings for Gleam! Supports everything modern React provides, with full Gleam Type-Checking system!
66
false
MIT
MIT
[ "ghivert" ]
redraw
34,582
false
false
2026-05-28T15:41:40.769642+00:00
186c5f71c3a34de70b8f76caffcac0c11c0c2133
1
Kacaii/senac-brigade-server/src/app/domain/brigade/delete_brigade.gleam
github
import app/domain/brigade/sql import app/web import app/web/context.{type Context} import gleam/http import gleam/json import gleam/list import gleam/result import pog import wisp import youid/uuid ///  Remove a brigade from the DataBase and return /// information about the deleted brigade as formatted JSON /// /// ...
src/app/domain/brigade/delete_brigade.gleam
https://github.com/Kacaii/senac-brigade-server
Kacaii
senac-brigade-server
Moved to Tangled! :sheep:
3
false
MIT
MIT
[ "Kacaii" ]
null
null
false
false
2026-05-28T16:00:03.898782+00:00
a1dd824b6021fddc246698ff0c552c12485ead34
1
eduardocodigo0/projecteuler_gleam/problem2/src/problem2.gleam
github
import gleam/int import gleam/io import gleam/list pub fn main() { fib(1, 1) |> list.filter(int.is_even) |> list.fold(0, int.add) |> int.to_string |> io.println } fn fib(prev: Int, current: Int) -> List(Int) { case current >= 4_000_000 { True -> [] False -> list.append([current], fib(current, curr...
problem2/src/problem2.gleam
https://github.com/eduardocodigo0/projecteuler_gleam
eduardocodigo0
projecteuler_gleam
Using Gleam language to solve some project euler challenges
0
false
Apache-2.0
Apache-2.0
[ "eduardocodigo0" ]
null
null
false
false
2026-05-28T16:22:29.426454+00:00
55ea6f2f5635836fb9b2f786a3f059e11fe4bd1f
1
han-tyumi/amber/test/amber/stdio_test.gleam
github
import amber/stderr import amber/stdin import amber/stdout import gleam/option.{Some} import gleeunit/should import gossamer/promise import gossamer/uint8_array pub fn stdio_stdin_read_test() { use result <- promise.then(stdin.read(uint8_array.new())) let assert Ok(nread) = result nread |> should.equal(Some(0)) ...
test/amber/stdio_test.gleam
https://github.com/han-tyumi/amber
han-tyumi
amber
✨🦕 Deno Bindings For Gleam 🧡
6
false
Apache-2.0
Apache-2.0
[ "han-tyumi" ]
amber
162,862
false
false
2026-05-28T15:54:08.543019+00:00
9e81573c4a29af049cc2d8ecf262cbbdf3f88951
1
ghivert/grille-pain/src/grille_pain/internals/css.gleam
github
pub fn var(content, default) { "var(--" <> content <> ", " <> default <> ")" }
src/grille_pain/internals/css.gleam
https://github.com/ghivert/grille-pain
ghivert
grille-pain
Toaster, made in lustre, for Gleam
25
false
MIT
MIT
[ "ghivert" ]
null
null
false
false
2026-05-28T15:44:00.594032+00:00
e0df46d6ca4fa7c459a33d56b85ed47c9647c7db
1
han-tyumi/amber/src/amber/build/arch.gleam
github
pub type Arch { X8664 Aarch64 Other(String) }
src/amber/build/arch.gleam
https://github.com/han-tyumi/amber
han-tyumi
amber
✨🦕 Deno Bindings For Gleam 🧡
6
false
Apache-2.0
Apache-2.0
[ "han-tyumi" ]
amber
162,862
false
false
2026-05-28T15:54:08.543019+00:00
9e81573c4a29af049cc2d8ecf262cbbdf3f88951
1
bruceesmith/m3e/test/m3e/calendar_test.gleam
github
//// Calendar unit tests //// //// This file was generated by m3e/generator //// //// DO NOT EDIT //// import gleam/list import gleam/option.{None, Some} import gleeunit/should import lustre/attribute import lustre/element import lustre/element/html import m3e/calendar.{Config} import m3e/calendar_view import...
test/m3e/calendar_test.gleam
https://github.com/bruceesmith/m3e
bruceesmith
m3e
Gleam/Lustre wrapper for M3E — Material 3 Expressive components
5
false
MIT
MIT
[ "bruceesmith" ]
m3e
213
false
false
2026-05-28T15:54:46.777053+00:00
d6c67d20925cf3f64da5929fe5149270b46df465
1
TrustBound/dream/poc/src/example.gleam
github
// Example usage of the radix trie-based router // // Demonstrates realistic route definitions with parameters, wildcards, // middleware, and streaming routes import dream/context import dream/http/request.{Delete, Get, Post, Put, Request} import dream/http/response.{Response, Text} import dream/router import gleam/in...
poc/src/example.gleam
https://github.com/TrustBound/dream
TrustBound
dream
Clean, composable web development for Gleam. No magic.
44
false
MIT
MIT
[ "TrustBound" ]
dream_postgres
911
false
false
2026-05-28T15:42:18.914603+00:00
98a7103c60ce0767d6fc1630f4a58779c2360206
1
uncle-samm/postgleam/test/postgleam/codec/date_test.gleam
github
import gleeunit/should import postgleam/codec/date import postgleam/codec/interval import postgleam/codec/time import postgleam/codec/timestamp import postgleam/codec/timestamptz import postgleam/codec/timetz import postgleam/value // --- date --- pub fn date_encode_epoch_test() { // 2000-01-01 = 0 days date.enco...
test/postgleam/codec/date_test.gleam
https://github.com/uncle-samm/postgleam
uncle-samm
postgleam
A pure Gleam PostgreSQL driver — a port of Elixir's Postgrex
1
false
Apache-2.0
Apache-2.0
[ "uncle-samm" ]
postgleam
450
false
false
2026-05-28T16:18:59.234919+00:00
2a7e540a8c64badd53ec17e01c46063d4f7f8838
1
veeso/blogatto/src/blogatto/internal/builder/feed/atom.gleam
github
//// Atom Feed builder. //// //// This module is responsible for generating Atom 1.0 feed XML files from //// the list of `AtomFeed` configurations declared in the user's `Config`. //// //// For each configured feed, the builder: //// //// 1. Resolves the absolute output path under `output_dir` and creates //// ...
src/blogatto/internal/builder/feed/atom.gleam
https://github.com/veeso/blogatto
veeso
blogatto
A Gleam framework for building static blogs with Lustre and Markdown or Djot. Generates HTML pages, RSS/Atom feeds, sitemaps, and robots.txt from markdown files with frontmatter, with multilingual support.
88
false
MIT
MIT
[ "veeso" ]
blogatto
1,087
false
false
2026-05-28T15:41:09.678283+00:00
67d9c5a9aab560718e23685a1100834f179b64d2
1
bigmoves/quickslice/client/src/generated/queries/get_statistics.gleam
github
import gleam/dynamic/decode import gleam/http/request.{type Request} import gleam/json import squall pub type Statistics { Statistics(record_count: Int, actor_count: Int, lexicon_count: Int) } pub fn statistics_decoder() -> decode.Decoder(Statistics) { use record_count <- decode.field("recordCount", decode.int) ...
client/src/generated/queries/get_statistics.gleam
https://github.com/bigmoves/quickslice
bigmoves
quickslice
Auto-indexing service and GraphQL API for AT Protocol Records
16
false
Apache-2.0
Apache-2.0
[ "bigmoves" ]
null
null
false
false
2026-05-28T15:45:53.367353+00:00
b28b31f480382e716bab7466ce2325fadaf1511b
1
dusty-phillips/glimpse/test/load_package_test.gleam
github
import glance import gleam/dict import glimpse import glimpse/error pub fn ok_module(contents: String) -> glance.Module { let assert Ok(module) = glance.module(contents) module } pub fn no_dependency_package_test() { let assert Ok(result) = glimpse.load_package("main_module", fn(_) { Ok("pub fn main() {}") ...
test/load_package_test.gleam
https://github.com/dusty-phillips/glimpse
dusty-phillips
glimpse
package loader and typechecker for glance
3
false
Apache-2.0
Apache-2.0
[ "dusty-phillips" ]
null
null
false
false
2026-05-28T16:00:43.924459+00:00
00d5021d6bd837aa6a113ef013299e0b49198539
1
GG-O-BP/kirari/src/kirari/ffi.gleam
github
//// FFI bare import 감지 — build/packages/ 내 .mjs 파일 정적 분석 import gleam/list import gleam/option import gleam/regexp import gleam/result import gleam/string import kirari/types.{type Dependency, type KirConfig, Dependency, Npm} import simplifile /// 감지된 FFI import 항목 pub type FfiDetection { FfiDetection(package_name...
src/kirari/ffi.gleam
https://github.com/GG-O-BP/kirari
GG-O-BP
kirari
✨ A modern package manager for Gleam that unifies Hex and npm.
3
false
MPL-2.0
MPL-2.0
[ "GG-O-BP" ]
null
null
false
false
2026-05-28T15:59:05.058220+00:00
695c56985cca86830a0c3b0209dd76da643b2ebe
1
mikkihugo/instructor_gleam/examples/basic_usage.gleam
github
// Example: Basic text classification with Instructor import gleam/io import gleam/option.{None, Some} import instructor import instructor/adapters/openai import instructor/types pub fn main() { // Create configuration let config = instructor.InstructorConfig( adapter: openai.openai_adapter(), defa...
examples/basic_usage.gleam
https://github.com/mikkihugo/instructor_gleam
mikkihugo
instructor_gleam
Structured outputs for LLMs in Gleam
0
false
MIT
MIT
[ "mikkihugo" ]
null
null
false
false
2026-05-28T16:32:18.470373+00:00
ce9d74085466e6a3187c4e4db680c73c045c933b
1
tantalumv/Glizzy/examples/lustre_app/src/lustre_utils/tree.gleam
github
import gleam/dict.{type Dict} import gleam/int import gleam/list import gleam/option.{type Option, None, Some} import gleam/string import lustre_utils/keyboard as keyboard pub type TreeItem { TreeItem( id: String, label: String, children: List(TreeItem), expanded: Bool, selected: Bool, ) } pub...
examples/lustre_app/src/lustre_utils/tree.gleam
https://github.com/tantalumv/Glizzy
tantalumv
Glizzy
A headless UI component library for Gleam and Lustre, inspired by Base UI and Shadcn
0
false
MIT
MIT
[ "tantalumv" ]
glizzy
235
false
false
2026-05-28T16:51:59.555773+00:00
bb770204df985c4b8c718a19e672d1930c32dcd8
1
tantalumv/Glizzy/examples/lustre_app/src/views/collections.gleam
github
import gleam/bool import gleam/dynamic/decode import gleam/int import gleam/list import gleam/option.{None, Some} import lustre/attribute.{attribute, class} import lustre/element.{type Element, none, text} import lustre/element/html.{button, div, h2, input, p} import lustre/event import lib/tailwind import lustre_utils...
examples/lustre_app/src/views/collections.gleam
https://github.com/tantalumv/Glizzy
tantalumv
Glizzy
A headless UI component library for Gleam and Lustre, inspired by Base UI and Shadcn
0
false
MIT
MIT
[ "tantalumv" ]
glizzy
235
false
false
2026-05-28T16:51:59.555773+00:00
bb770204df985c4b8c718a19e672d1930c32dcd8
1
TrustBound/dream/test/matchers/extract_user_name.gleam
github
//// Custom matcher to extract a field from a validation result. import dream/http/validation import dream_test/types.{ type MatchResult, AssertionFailure, CustomMatcherFailure, MatchFailed, MatchOk, } import gleam/option.{Some} /// Extract a field from a successful validation result using a getter function. /// //...
test/matchers/extract_user_name.gleam
https://github.com/TrustBound/dream
TrustBound
dream
Clean, composable web development for Gleam. No magic.
44
false
MIT
MIT
[ "TrustBound" ]
dream_postgres
911
false
false
2026-05-28T15:42:18.914603+00:00
98a7103c60ce0767d6fc1630f4a58779c2360206
1
avit-io/dagger_gleam/sdk/src/examples/secret_env.gleam
github
// sdk/src/examples/secret_env.gleam // // Pass a secret as an environment variable into a container without // ever exposing its value in logs or the Dagger cache. // // Run with: // dgl generate // MY_TOKEN=supersecret dagger run --progress="plain" gleam run -m examples/secret_env import dagger import dagger/dsl...
sdk/src/examples/secret_env.gleam
https://github.com/avit-io/dagger_gleam
avit-io
dagger_gleam
A Gleam SDK for Dagger that generates type-safe, idiomatic bindings from the GraphQL schema. Built around a CPS interpreter and deferred execution model to keep data separate from side effects.
0
false
MIT
MIT
[ "avit-io" ]
dagger_gleam
95
false
false
2026-05-28T16:50:06.055729+00:00
7807ef48f5fe85177d3a0527e716bd6280702283
1
dinkelspiel/kirakira/server/src/server/routes/auth/forgot_password.gleam
github
import gleam/dynamic import gleam/dynamic/decode import gleam/http.{Get, Post} import gleam/httpc import gleam/json import gleam/result import gleesend import gleesend/emails import server/db/forgot_password import server/env.{get_env} import server/response import wisp.{type Request, type Response} pub fn forgot_pass...
server/src/server/routes/auth/forgot_password.gleam
https://github.com/dinkelspiel/kirakira
dinkelspiel
kirakira
A lobste.rs like forum made in Gleam
32
false
Apache-2.0
Apache-2.0
[ "dinkelspiel" ]
null
null
false
false
2026-05-28T15:43:15.917812+00:00
f8368f0d3f232ee7a6f4506ad0c5471988cf1772
1
giacomocavalieri/youtube_views/src/youtube_views.gleam
github
import envoy import gleam/dynamic/decode import gleam/http.{Get, Https} import gleam/http/request.{type Request} import gleam/httpc import gleam/int import gleam/io import gleam/json import gleam/list import gleam/order import gleam/result import gleam/string type Video { Video(title: String, id: String, statistics:...
src/youtube_views.gleam
https://github.com/giacomocavalieri/youtube_views
giacomocavalieri
youtube_views
0
false
Apache-2.0
Apache-2.0
[ "giacomocavalieri" ]
null
null
false
false
2026-05-28T16:30:27.454696+00:00
d36bffa7196156f4a609a9dde4489f2c24fba8b6
1
karlsson/glite/src/glite/service.gleam
github
import gleam/erlang/process import gleam/io import gleam/otp/actor import gleam/otp/factory_supervisor as fsup import gleam/string import glite/msg.{type SReqS} pub type SupName(c) = process.Name(fsup.Message(process.Subject(msg.ClientRequest(String)), c)) type State(c) { State(sup_name: SupName(c), no_reqs: Int)...
src/glite/service.gleam
https://github.com/karlsson/glite
karlsson
glite
The Gleamlins little intro to Erlang applications
31
false
Apache-2.0
Apache-2.0
[ "karlsson" ]
glite
55
false
false
2026-05-28T15:43:26.960217+00:00
9328703778b4e82a82bae2d2951cbcf037dc680a
1
inoas/gleam-cake-shork/src/cake_shork.gleam
github
import gleam/io /// As a library *cake_shork* cannot be invoked directly in a meaningful way. /// @internal pub fn main() { { "\n" <> "cake_shork is an adapter library and cannot be invoked directly." } |> io.println }
src/cake_shork.gleam
https://github.com/inoas/gleam-cake-shork
inoas
gleam-cake-shork
🎂Cake 🦭MariaDB and 🐬MySQL adapter which passes PreparedStatements to the shork library for execution - written in Gleam.
2
false
MPL-2.0
MPL-2.0
[ "inoas" ]
null
null
false
false
2026-05-28T16:03:54.106786+00:00
ebc923fdafb85821e3cd92d83d7566da79e6fe24
1
End of preview. Expand in Data Studio

Gleam Code Corpus

A structured, attributed corpus of 22,581 Gleam source files collected from 1,528 GitHub repositories for continued pre-training and code generation research.

Overview

This dataset contains .gleam source files from the Gleam programming language ecosystem. Every file includes full attribution — repo owner, name, URL, license, star count, and Hex.pm package metadata where available.

What this is for:

  • Continued pre-training (CPT) of code-focused language models
  • Fine-tuning models for Gleam code generation
  • Research on small programming language ecosystems
  • Reference corpus for Gleam idioms and patterns

What this is NOT:

  • Instruction/response pairs (see the companion gleam-sft dataset, coming later)
  • Documentation (language tour, hexdocs — separate dataset, coming later)
  • Raw/unfiltered data (generated files, unlicensed code, and duplicates have been removed)

Dataset Configs

Config Files Size Description
all 22,581 27 MB Full filtered corpus
official 296 422 KB Official repos only (gleam-lang, gleam-wisp, lustre-labs)
community_top 6,702 8 MB Community repos with stars ≥ 10 or Hex downloads ≥ 1,000

All configs contain only permissively licensed, deduplicated code.

Schema

Each record is a single .gleam file with full attribution:

Field Type Description
id string {owner}/{repo}/{file_path} — unique identifier
source string Always "github"
code string Raw file contents
file_path string Path within the repository
repo_url string GitHub repository URL
repo_owner string Repository owner/organization
repo_name string Repository name
repo_description string Repository description from GitHub
stars int GitHub star count at collection time
is_official bool True if owner is gleam-lang, gleam-wisp, or lustre-labs
license string Normalized SPDX license identifier
license_raw string Original license string from source
authors list[string] Repository authors/contributors
hex_package string? Hex.pm package name (null if not on Hex)
hex_downloads int? Hex.pm download count (null if not on Hex)
fork bool Whether the repo is a fork (unreliable — see notes)
archived bool Whether the repo is archived
collected_at string ISO 8601 timestamp of collection
commit_sha string Git commit SHA of the snapshot
schema_version int Schema version (currently 1)

Collection Methodology

  1. Discovery: GitHub search API with language:gleam, using star-range + date-range chunking to bypass the 1,000-result-per-query limit. Discovered 4,660 unique repositories across 17 query chunks.

  2. Enrichment: Cross-referenced with Hex.pm search=gleam (1,035 packages) to add package names and download counts.

  3. Collection: Shallow-cloned each repo (git clone --depth 1), extracted all .gleam files. 4,489 repos processed, 0 clone failures.

  4. Filtering: Applied a multi-stage quality pipeline:

    Filter Removed Reason
    Generated files (>50K chars) 666 Auto-generated schemas, lookup tables, data dumps
    Stub files (<20 chars) 316 Empty/placeholder files
    Unlicensed repos 42,368 No license and no Hex package
    Non-permissive licenses 0 GPL, AGPL removed
    Exercism repos 840 Same exercises solved repeatedly — low diversity
    Content deduplication 2,642 Identical code from different repos (kept highest-starred)

    69,413 raw files → 22,581 clean files (67% reduction)

Statistics

Corpus

  • 22,581 files from 1,528 repos
  • 4.3M lines, 121M characters
  • Median file: 2,692 chars; Mean: 5,352 chars; Max: 49,945 chars

License Distribution

  • MIT: 57% (13,068 files)
  • Apache-2.0: 40% (8,723 files)
  • Other permissive: 3% (MPL-2.0, BSD, ISC, Unlicense, 0BSD, CC0-1.0)

Source Distribution

  • src/ files: 48%
  • test/ files: 24%
  • examples/ files: 6%
  • Other: 22%

Star Distribution

Stars Files %
0 6,904 31%
1–4 6,842 30%
5–9 3,432 15%
10–49 3,602 16%
50–99 757 3.4%
100–999 918 4.1%
1000+ 126 0.6%

Known Limitations

  • fork field is unreliable: GitHub search API doesn't consistently mark forks. All records show fork=false. Some near-duplicate fork content may be present (content dedup catches exact copies only).
  • Near-duplicate forks: Diverged forks (e.g., Ivan-Vakhula07/lustre vs lustre-labs/lustre) survived dedup because their files differ slightly. These are valid Gleam code and not harmful for training.
  • Semi-generated content: dusty-phillips/monks_of_style contributes 496 files (2.2%) of auto-generated CSS property wrappers from MDN documentation. Each file is valid Gleam but follows an identical template.
  • Hex.pm enrichment incomplete: Only 44% of files (10,015) have Hex package metadata. The rest are from repos not published on Hex.
  • Collection snapshot: Data was collected on 2026-05-28. Repositories may have changed since.

Licensing

This dataset aggregates code from many repositories, each with their own license. The license field in each record contains the normalized SPDX identifier. All included code is under permissive licenses:

  • MIT
  • Apache-2.0
  • MPL-2.0
  • BSD-3-Clause
  • BSD-2-Clause
  • ISC
  • Unlicense
  • 0BSD
  • CC0-1.0

The dataset card and curation scripts are released under the same license terms as the underlying code. See individual records for specific license attribution.

How to Use

from datasets import load_dataset

# Load full corpus
ds = load_dataset("kasuboski/gleam-code-corpus", config="all")

# Load only official Gleam repos
ds = load_dataset("kasuboski/gleam-code-corpus", config="official")

# Load community top (stars >= 10 or hex_downloads >= 1000)
ds = load_dataset("kasuboski/gleam-code-corpus", config="community_top")

# Access a record
record = ds["train"][0]
print(record["code"])           # the Gleam source code
print(record["repo_url"])       # GitHub URL for attribution
print(record["license"])        # SPDX license identifier

Acknowledgments

  • The Gleam language team and community
  • Hex.pm for package metadata
  • All the repository authors whose code is included in this corpus
Downloads last month
59