Mgmgrand420/google-code-archive
收藏Hugging Face2026-01-22 更新2026-03-29 收录
下载链接:
https://hf-mirror.com/datasets/Mgmgrand420/google-code-archive
下载链接
链接失效反馈官方服务:
资源简介:
---
annotations_creators:
- machine-generated
language_creators:
- found
language:
- code
- en
license: other
multilinguality:
- multilingual
pretty_name: Google Code Archive Dataset
size_categories:
- 10M<n<100M
source_datasets:
- original
task_categories:
- text-generation
tags:
- code
- google-code
- archive
configs:
- config_name: default
data_files:
- split: train
path: "data/*.parquet"
default: true
dataset_info:
features:
- name: code
dtype: string
- name: repo_name
dtype: string
- name: path
dtype: string
- name: language
dtype: string
- name: license
dtype: string
- name: size
dtype: int64
---
# Google Code Archive Dataset
## Dataset Description
This dataset was compiled from the [Google Code Archive](https://code.google.com/archive/), a preserved snapshot of projects hosted on Google Code, Google's open-source project hosting service that operated from 2006 to 2016. Google Code was one of the major code hosting platforms of its era, hosting hundreds of thousands of open-source projects before its shutdown. The archive provides a unique historical record of open-source development during a formative period of modern software engineering.
### Dataset Summary
| Statistic | Value |
|-----------|-------|
| **Total Files** | 65,825,565 |
| **Total Repositories** | 488,618 |
| **Total Size** | 47 GB (compressed Parquet) |
| **Programming Languages** | 454 |
| **File Format** | Parquet with Zstd compression (71 files) |
### Key Features
- **Historical open-source corpus**: Contains code from over 488K repositories hosted on Google Code during 2006-2016
- **Diverse language coverage**: Spans 454 programming languages identified by [go-enry](https://github.com/go-enry/go-enry) (based on GitHub Linguist rules)
- **Rich metadata**: Includes repository name, file path, detected language, license information, and file size
- **Quality filtered**: Extensive filtering to remove vendor code, build artifacts, generated files, and low-quality content
- **Era-specific patterns**: Captures coding conventions and library usage from the pre-modern era of software development
### Languages
The dataset includes 454 programming languages. The top 30 languages by file count:
| Rank | Language | File Count |
|------|----------|------------|
| 1 | Java | 16,331,993 |
| 2 | PHP | 12,764,574 |
| 3 | HTML | 5,705,184 |
| 4 | C++ | 5,090,685 |
| 5 | JavaScript | 4,937,765 |
| 6 | C | 4,179,202 |
| 7 | C# | 3,872,245 |
| 8 | Python | 2,207,240 |
| 9 | CSS | 1,697,385 |
| 10 | Objective-C | 1,186,050 |
| 11 | Shell | 639,183 |
| 12 | Java Server Pages | 541,498 |
| 13 | ActionScript | 540,557 |
| 14 | Makefile | 481,563 |
| 15 | ASP.NET | 381,389 |
| 16 | Smarty | 339,555 |
| 17 | Ruby | 331,743 |
| 18 | Go | 316,427 |
| 19 | Perl | 307,960 |
| 20 | Vim Script | 216,236 |
| 21 | Lua | 215,226 |
| 22 | HTML+PHP | 150,781 |
| 23 | HTML+Razor | 149,131 |
| 24 | MATLAB | 145,686 |
| 25 | Batchfile | 138,523 |
| 26 | Pascal | 135,992 |
| 27 | Visual Basic .NET | 118,732 |
| 28 | TeX | 110,379 |
| 29 | Less | 98,221 |
| 30 | Unix Assembly | 94,758 |
### Licenses
The dataset includes files from repositories with various licenses as specified in the Google Code Archive:
| License | File Count |
|---------|------------|
| Apache License 2.0 (asf20) | 21,568,143 |
| GNU GPL v3 (gpl3) | 14,843,470 |
| GNU GPL v2 (gpl2) | 6,824,185 |
| Other Open Source (oos) | 5,433,436 |
| MIT License (mit) | 4,754,567 |
| GNU LGPL (lgpl) | 4,073,137 |
| BSD License (bsd) | 3,787,348 |
| Artistic License (art) | 1,910,047 |
| Eclipse Public License (epl) | 1,587,289 |
| Mozilla Public License 1.1 (mpl11) | 580,102 |
| Multiple Licenses (multiple) | 372,457 |
| Google Summer of Code (gsoc) | 63,292 |
| Public Domain (publicdomain) | 28,092 |
## Dataset Structure
### Data Fields
| Field | Type | Description |
|-------|------|-------------|
| `code` | string | Content of the source file (UTF-8 encoded) |
| `repo_name` | string | Name of the Google Code project |
| `path` | string | Path of the file within the repository (relative to repo root) |
| `language` | string | Programming language as identified by [go-enry](https://github.com/go-enry/go-enry) |
| `license` | string | License of the repository (Google Code license identifier) |
| `size` | int64 | Size of the source file in bytes |
### Data Format
- **Format**: Apache Parquet with Zstd compression
- **File Structure**: 71 files (`google_code_0000.parquet` to `google_code_0070.parquet`)
### Data Splits
All examples are in the train split. There is no validation or test split.
### Example Data Point
```
{
'code': 'public class HundredIntegers {\n\tpublic static void main (String[] args) {\n\t\tfor (int i = 1; i<=100; i++) {\n\t\t\tSystem.out.println(i);\n\t\t}\n\t}\n}',
'repo_name': '100integers',
'path': 'HundredIntegers.java',
'language': 'Java',
'license': 'epl',
'size': 147
}
```
## Dataset Creation
### Pipeline Overview
The dataset was created through a multi-stage pipeline:
1. **Project Discovery**: Fetching project metadata from the Google Code Archive
2. **Source Filtering**: Selecting projects that have source code available (`hasSource: true`)
3. **Archive Downloading**: Downloading source archives from the Google Code Archive storage
4. **Content Extraction**: Extracting and filtering source code files
5. **Parquet Generation**: Writing filtered records to Parquet shards with Zstd compression
### Language Detection
Programming languages are detected using [go-enry](https://github.com/go-enry/go-enry), a Go port of GitHub's Linguist library. Only files classified as **Programming** or **Markup** language types are included (Data and Prose types are excluded).
### License Detection
Licenses are obtained directly from the Google Code Archive project metadata. The archive preserves the original license selection made by project owners when creating their repositories on Google Code.
### File Filtering
Extensive filtering is applied to ensure data quality:
#### Size Limits
| Limit | Value |
|-------|-------|
| Max repository archive size | 64 MB |
| Max single file size | 2 MB |
| Max line length | 1,000 characters |
#### Excluded Directories
- **Configuration**: `.git/`, `.github/`, `.gitlab/`, `.vscode/`, `.idea/`, `.vs/`, `.settings/`, `.eclipse/`, `.project/`, `.metadata/`
- **Vendor/Dependencies**: `node_modules/`, `bower_components/`, `jspm_packages/`, `vendor/`, `third_party/`, `3rdparty/`, `external/`, `packages/`, `deps/`, `lib/vendor/`, `target/dependency/`, `Pods/`
- **Build Output**: `build/`, `dist/`, `out/`, `bin/`, `target/`, `release/`, `debug/`, `.next/`, `.nuxt/`, `_site/`, `_build/`, `__pycache__/`, `.pytest_cache/`, `cmake-build-*`, `.gradle/`, `.maven/`
#### Excluded Files
- **Lock Files**: `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `Gemfile.lock`, `Cargo.lock`, `poetry.lock`, `Pipfile.lock`, `composer.lock`, `go.sum`, `mix.lock`
- **Minified Files**: Any file containing `.min.` in the name
- **Binary Files**: `.exe`, `.dll`, `.so`, `.dylib`, `.a`, `.lib`, `.o`, `.obj`, `.jar`, `.war`, `.ear`, `.class`, `.pyc`, `.pyo`, `.wasm`, `.bin`, `.dat`, `.pdf`, `.doc`, `.docx`, `.xls`, `.xlsx`, `.ppt`, `.pptx`, `.zip`, `.tar`, `.gz`, `.bz2`, `.7z`, `.rar`, `.jpg`, `.jpeg`, `.png`, `.gif`, `.bmp`, `.ico`, `.svg`, `.mp3`, `.mp4`, `.avi`, `.mov`, `.wav`, `.flac`, `.ttf`, `.otf`, `.woff`, `.woff2`, `.eot`
- **System Files**: `.DS_Store`, `thumbs.db`
#### Content Filtering
- **UTF-8 Validation**: Files must be valid UTF-8 encoded text
- **Binary Detection**: Files detected as binary by go-enry are excluded
- **Generated Files**: Files with generation markers in the first 500 bytes are excluded:
- `generated by`, `do not edit`, `auto-generated`, `autogenerated`, `@generated`, `<auto-generated`
- **Empty Files**: Files that are empty or contain only whitespace are excluded
- **Long Lines**: Files with any line exceeding 1,000 characters are excluded
- **go-enry Filters**: Additional filtering using go-enry's `IsVendor()`, `IsImage()`, `IsDotFile()`, `IsTest()`, and `IsGenerated()` functions
- **Documentation-only Repos**: Repositories containing only documentation files (no actual code) are skipped
### Source Data
All data originates from the [Google Code Archive](https://code.google.com/archive/), which preserves projects hosted on Google Code before its shutdown in January 2016.
## Considerations for Using the Data
### Historical Context
This dataset represents code from 2006-2016 and may contain:
- Outdated coding patterns and deprecated APIs
- Legacy library dependencies that are no longer maintained
- Security vulnerabilities that have since been discovered and patched
- Code written for older language versions (Python 2, older Java versions, etc.)
Users should be aware that this code reflects historical practices and may not represent modern best practices.
### Personal and Sensitive Information
The dataset may contain:
- Email addresses in code comments or configuration files
- API keys or credentials that were accidentally committed
- Personal information in comments or documentation
Users should exercise caution and implement appropriate filtering when using this data.
### Licensing Information
This dataset is a collection of source code from repositories with various licenses. Any use of all or part of the code gathered in this dataset must abide by the terms of the original licenses, including attribution clauses when relevant. The license field in each data point indicates the license of the source repository.
---
annotations_creators:
- 机器生成
language_creators:
- 公开采集
language:
- 代码(code)
- 英语(en)
license: 其他
multilinguality:
- 多语言
pretty_name: 谷歌代码档案数据集(Google Code Archive Dataset)
size_categories:
- 1000万 < n < 1亿
source_datasets:
- 原始数据集
task_categories:
- 文本生成
tags:
- 代码(code)
- 谷歌代码(google-code)
- 档案(archive)
configs:
- config_name: 默认
data_files:
- split: 训练集(train)
path: "data/*.parquet"
default: true
dataset_info:
features:
- name: 代码(code)
dtype: 字符串(string)
- name: 仓库名称(repo_name)
dtype: 字符串(string)
- name: 文件路径(path)
dtype: 字符串(string)
- name: 编程语言(language)
dtype: 字符串(string)
- name: 许可证(license)
dtype: 字符串(string)
- name: 文件大小(size)
dtype: 64位整数(int64)
---
# 谷歌代码档案数据集(Google Code Archive Dataset)
## 数据集描述
本数据集源自[谷歌代码档案库(Google Code Archive)](https://code.google.com/archive/),该档案库保存了2006年至2016年间谷歌开源项目托管服务Google Code上的所有项目快照。Google Code曾是当时主流的代码托管平台之一,在关停前托管了数十万计的开源项目。该档案库为现代软件工程形成期的开源开发历程提供了独一无二的历史记录。
### 数据集概览
| 统计项 | 数值 |
|-----------|-------|
| **总文件数** | 65,825,565 |
| **总仓库数** | 488,618 |
| **总大小** | 47 GB(压缩后的Parquet格式) |
| **支持编程语言数量** | 454 |
| **文件格式** | 采用Zstd压缩的Parquet格式(共71个文件) |
### 核心特性
- **历史开源语料库**:包含2006-2016年间Google Code上超过48.8万个仓库的代码
- **多语言覆盖**:覆盖由[go-enry](https://github.com/go-enry/go-enry)(基于GitHub Linguist规则)识别的454种编程语言
- **丰富元数据**:包含仓库名称、文件路径、检测到的编程语言、许可证信息以及文件大小
- **质量过滤**:经过多轮过滤以移除第三方代码、构建产物、生成文件及低质量内容
- **时代特定编码模式**:捕捉了软件开发现代纪元前的编码约定与库使用习惯
### 编程语言分布
本数据集包含454种编程语言,按文件数量排序的前30种编程语言如下:
| 排名 | 编程语言 | 文件数量 |
|------|----------|------------|
| 1 | Java | 16,331,993 |
| 2 | PHP | 12,764,574 |
| 3 | HTML | 5,705,184 |
| 4 | C++ | 5,090,685 |
| 5 | JavaScript | 4,937,765 |
| 6 | C | 4,179,202 |
| 7 | C# | 3,872,245 |
| 8 | Python | 2,207,240 |
| 9 | CSS | 1,697,385 |
| 10 | Objective-C | 1,186,050 |
| 11 | Shell | 639,183 |
| 12 | Java Server Pages | 541,498 |
| 13 | ActionScript | 540,557 |
| 14 | Makefile | 481,563 |
| 15 | ASP.NET | 381,389 |
| 16 | Smarty | 339,555 |
| 17 | Ruby | 331,743 |
| 18 | Go | 316,427 |
| 19 | Perl | 307,960 |
| 20 | Vim Script | 216,236 |
| 21 | Lua | 215,226 |
| 22 | HTML+PHP | 150,781 |
| 23 | HTML+Razor | 149,131 |
| 24 | MATLAB | 145,686 |
| 25 | Batchfile | 138,523 |
| 26 | Pascal | 135,992 |
| 27 | Visual Basic .NET | 118,732 |
| 28 | TeX | 110,379 |
| 29 | Less | 98,221 |
| 30 | Unix Assembly | 94,758 |
### 许可证分布
本数据集包含来自不同许可证仓库的文件,具体如下:
| 许可证 | 文件数量 |
|---------|------------|
| Apache许可证2.0(asf20) | 21,568,143 |
| GNU GPL v3(gpl3) | 14,843,470 |
| GNU GPL v2(gpl2) | 6,824,185 |
| 其他开源许可(oos) | 5,433,436 |
| MIT许可证(mit) | 4,754,567 |
| GNU LGPL(lgpl) | 4,073,137 |
| BSD许可证(bsd) | 3,787,348 |
| Artistic许可证(art) | 1,910,047 |
| Eclipse公共许可证(epl) | 1,587,289 |
| Mozilla公共许可证1.1(mpl11) | 580,102 |
| 多许可证(multiple) | 372,457 |
| 谷歌编程之夏(gsoc) | 63,292 |
| 公共领域(publicdomain) | 28,092 |
## 数据集结构
### 数据字段
| 字段名 | 数据类型 | 描述 |
|-------|------|-------------|
| `code` | 字符串 | 源文件内容(采用UTF-8编码) |
| `repo_name` | 字符串 | Google Code项目的名称 |
| `path` | 字符串 | 文件在仓库内的相对根目录路径 |
| `language` | 字符串 | 由[go-enry](https://github.com/go-enry/go-enry)识别的编程语言 |
| `license` | 字符串 | 仓库的许可证(使用Google Code许可证标识符) |
| `size` | 64位整数 | 源文件的字节大小 |
### 数据格式
- **格式**:采用Zstd压缩的Apache Parquet格式
- **文件结构**:共71个文件(命名格式为`google_code_0000.parquet`至`google_code_0070.parquet`)
### 数据分割
所有样本均位于训练分割(train split)中,无验证集与测试集。
### 示例数据点
{
'code': 'public class HundredIntegers {
public static void main (String[] args) {
for (int i = 1; i<=100; i++) {
System.out.println(i);
}
}
}',
'repo_name': '100integers',
'path': 'HundredIntegers.java',
'language': 'Java',
'license': 'epl',
'size': 147
}
## 数据集创建流程
### 流水线总览
本数据集通过多阶段流水线创建:
1. **项目发现**:从Google Code档案库获取项目元数据
2. **源文件筛选**:选择包含源代码的项目(`hasSource: true`)
3. **档案下载**:从Google Code档案库存储中下载源代码归档文件
4. **内容提取**:提取并过滤源代码文件
5. **Parquet生成**:将过滤后的记录写入采用Zstd压缩的Parquet分片文件
### 语言检测
编程语言通过[go-enry](https://github.com/go-enry/go-enry)检测,该工具是GitHub Linguist库的Go语言移植版本。仅保留被归类为**编程类**或**标记类**的语言文件(排除数据类与文本类文件)。
### 许可证检测
许可证信息直接源自Google Code档案库的项目元数据。该档案库保留了项目所有者在Google Code上创建仓库时选择的原始许可证信息。
### 文件过滤
为确保数据质量,本数据集应用了多轮过滤:
#### 大小限制
| 限制项 | 数值 |
|-------|-------|
| 单个仓库归档最大大小 | 64 MB |
| 单个文件最大大小 | 2 MB |
| 单行最大长度 | 1000 字符 |
#### 排除目录
- **配置文件目录**:`.git/`、`.github/`、`.gitlab/`、`.vscode/`、`.idea/`、`.vs/`、`.settings/`、`.eclipse/`、`.project/`、`.metadata/`
- **第三方依赖目录**:`node_modules/`、`bower_components/`、`jspm_packages/`、`vendor/`、`third_party/`、`3rdparty/`、`external/`、`packages/`、`deps/`、`lib/vendor/`、`target/dependency/`、`Pods/`
- **构建输出目录**:`build/`、`dist/`、`out/`、`bin/`、`target/`、`release/`、`debug/`、`.next/`、`.nuxt/`、`_site/`、`_build/`、`__pycache__/`、`.pytest_cache/`、`cmake-build-*`、`.gradle/`、`.maven/`
#### 排除文件
- **锁定文件**:`package-lock.json`、`yarn.lock`、`pnpm-lock.yaml`、`Gemfile.lock`、`Cargo.lock`、`poetry.lock`、`Pipfile.lock`、`composer.lock`、`go.sum`、`mix.lock`
- **压缩后的文件**:文件名中包含`.min.`的文件
- **二进制文件**:`.exe`、`.dll`、`.so`、`.dylib`、`.a`、`.lib`、`.o`、`.obj`、`.jar`、`.war`、`.ear`、`.class`、`.pyc`、`.pyo`、`.wasm`、`.bin`、`.dat`、`.pdf`、`.doc`、`.docx`、`.xls`、`.xlsx`、`.ppt`、`.pptx`、`.zip`、`.tar`、`.gz`、`.bz2`、`.7z`、`.rar`、`.jpg`、`.jpeg`、`.png`、`.gif`、`.bmp`、`.ico`、`.svg`、`.mp3`、`.mp4`、`.avi`、`.mov`、`.wav`、`.flac`、`.ttf`、`.otf`、`.woff`、`.woff2`、`.eot`
- **系统文件**:`.DS_Store`、`thumbs.db`
#### 内容过滤
- **UTF-8验证**:文件必须为有效的UTF-8编码文本
- **二进制检测**:被go-enry识别为二进制的文件将被排除
- **生成文件过滤**:排除前500字节中包含生成标记的文件:
- `generated by`、`do not edit`、`auto-generated`、`autogenerated`、`@generated`、`<auto-generated`
- **空文件过滤**:空文件或仅包含空白字符的文件将被排除
- **长行过滤**:包含任意长度超过1000字符的行的文件将被排除
- **go-enry过滤**:使用go-enry的`IsVendor()`、`IsImage()`、`IsDotFile()`、`IsTest()`、`IsGenerated()`函数进行额外过滤
- **仅文档仓库过滤**:仅包含文档文件(无实际代码)的仓库将被跳过
## 源数据
所有数据均源自[谷歌代码档案库(Google Code Archive)](https://code.google.com/archive/),该库保存了2016年1月关停前托管在Google Code上的所有项目。
## 数据集使用注意事项
### 历史背景
本数据集收录的代码来自2006-2016年,可能包含:
- 过时的编码模式与已弃用的API
- 不再维护的遗留库依赖
- 已被发现并修复的安全漏洞
- 针对旧版语言版本编写的代码(如Python 2、旧版Java等)
用户应注意,本数据集的代码反映了当时的开发实践,可能不符合现代最佳实践。
### 个人与敏感信息
本数据集可能包含:
- 代码注释或配置文件中的电子邮件地址
- 意外提交的API密钥或凭证
- 注释或文档中的个人信息
用户在使用该数据时应保持谨慎,并实施适当的过滤措施。
### 许可证信息
本数据集是包含多种许可证的源代码仓库的集合。对本数据集中全部或部分代码的任何使用都必须遵守原始许可证的条款,包括相关的署名要求。每个数据点中的`license`字段指示了其所属源仓库的许可证。
提供机构:
Mgmgrand420


