textcodeparrot/codeparrot-cleanpythoncodegithubpretrainingcode-generationdeduplicatedlanguage-modelfine-tuning

CodeParrot Clean — Deduplicated Python Code

Free

Open dataset

Sample structure: 100 / 100
3 download links issued
Seller: DataBazaar
Sign up to download

Already have an account? Log in

Agent? Connect your account →

Category
Text
Records
477,028 rows
Format
PARQUET
Update Frequency
Not documented
Collection Method
auto_imported_huggingface_federated
PII
No flagged field names; not a privacy audit
File Size
~1726.2 MB
Download links issued
3

Source, license and coverage

Supplier documentation. These claims are separate from the automated sample score. A listing edit date is not a data freshness date.

License
Not documented — confirm reuse terms with the seller
Source / creator
codeparrot/codeparrot-clean
Collection method
The CodeParrot team queried public GitHub for Python files, then applied the following cleaning pipeline: (1) exact-match deduplication on file content hash; (2) filter to files with average line length < 100 and max line length < 1000; (3) require alphanumeric character fraction > 0.25; (4) drop files matching keywords associated with auto-generated code. The result is a cleaner, lower-redundancy corpus than the raw scrape, oriented toward training code generation models.
Coverage start
Not documented
Coverage end
Not documented
Data last updated
Not documented
Update schedule
Not documented

Source documentation ↗

- Snapshot is from 2022; does not reflect recent Python ecosystem changes (e.g., newer libraries, typing patterns, recent frameworks). - Per-file license metadata is best-effort from repo-level detection; downstream users must respect individual file licenses for derivative works. - Filtering heuristics (alphanumeric fraction, auto-generated keyword list) are imperfect — some boilerplate and generated code remain. - Python only; not suitable for multi-language code modeling without augmentation. - Likely overlap with common code benchmarks (HumanEval, MBPP) — leakage risk if used to train models evaluated on those suites.

Sample structure score: 100 / 100

This automated check describes the inspected sample, not factual accuracy, legal rights, representativeness, or the quality of the entire dataset. It is not a customer rating.

Assessed 10 sample records (JSON) on 2026-10-09. All records in the provided sample were checked.

CheckPointsEvidence
Populated cells50 / 50110 of 110 top-level cells contain a value. Null, absent and blank values count as missing; zero and false count as populated.
Consistent value types30 / 30110 of 110 populated cells match their column's most common observed type. Types are inferred, not checked against real-world truth.
Consistent record shape20 / 2010 of 10 records have the expected fields. CSV/TSV use the header width; JSON uses the union of observed keys.
Field-level findings and improvements

Check missing cells and mixed types below. Document intentional missing values or mixed types in your field descriptions. Do not fill legitimate unknowns with invented values just to increase this score.

FieldMissing cellsMost common typeOther populated types
repo_name0 / 10string0 / 10
path0 / 10string0 / 10
copies0 / 10number0 / 10
size0 / 10number0 / 10
content0 / 10string0 / 10
license0 / 10string0 / 10
hash0 / 10number0 / 10
line_mean0 / 10number0 / 10
line_max0 / 10number0 / 10
alpha_frac0 / 10number0 / 10
autogenerated0 / 10boolean0 / 10
How the score is calculated, its limitations, and how to correct an assessment →

About this data

Cleaned and deduplicated Python source code from GitHub, filtered for line length, alphanumeric fraction, and auto-generated content. Commonly used for code language model pretraining and fine-tuning.

Retrieve with your agent or Python

Create an account and configure DATABAZAAR_API_KEY. This example retrieves free or already purchased data; it never makes a purchase. For a multi-file dataset, choose a file index from the manifest.

Download the Python example
python3 retrieve-dataset.py 4b6d4631-e372-4ac9-80ce-30489f8d8e00 --output dataset.bin
Full supplier documentation
## Overview CodeParrot Clean is a large corpus of Python source files scraped from public GitHub repositories, cleaned and deduplicated for use in code language model pretraining and fine-tuning. The dataset contains roughly 5M+ Python files (1M<n<10M size class) in JSON format with content and repository metadata. Snapshot reflects GitHub state as of the original CodeParrot collection (circa 2022). ## Schema - `content` — string — raw Python source code of the file - `repo_name` — string — GitHub repository identifier (owner/repo) - `path` — string — file path within the repository - `copies` — int — number of near-duplicate copies observed before dedup - `size` — int — file size in bytes - `license` — string — detected license of the source repo (where available) - `hash` — string — content hash used for deduplication - `line_mean` / `line_max` — float/int — line length statistics used in filtering - `alpha_frac` — float — fraction of alphanumeric characters - `autogenerated` — bool — heuristic flag for autogenerated code ## Sources - HuggingFace: https://huggingface.co/datasets/codeparrot/codeparrot-clean — original source files scraped from public GitHub via BigQuery / GH Archive. - Upstream parent: codeparrot/codeparrot (raw, undeduplicated). - License: dataset card does not assert a single uniform license; underlying files retain their original repo licenses. Aggregated dataset is distributed as research/open access on HF. ## Methodology The CodeParrot team queried public GitHub for Python files, then applied the following cleaning pipeline: (1) exact-match deduplication on file content hash; (2) filter to files with average line length < 100 and max line length < 1000; (3) require alphanumeric character fraction > 0.25; (4) drop files matching keywords associated with auto-generated code. The result is a cleaner, lower-redundancy corpus than the raw scrape, oriented toward training code generation models. ## Known gaps & limitations - Snapshot is from 2022; does not reflect recent Python ecosystem changes (e.g., newer libraries, typing patterns, recent frameworks). - Per-file license metadata is best-effort from repo-level detection; downstream users must respect individual file licenses for derivative works. - Filtering heuristics (alphanumeric fraction, auto-generated keyword list) are imperfect — some boilerplate and generated code remain. - Python only; not suitable for multi-language code modeling without augmentation. - Likely overlap with common code benchmarks (HumanEval, MBPP) — leakage risk if used to train models evaluated on those suites. ## Intended use & out-of-scope - **Intended:** pretraining/fine-tuning code LMs for Python, RAG over Python code, static analysis research, code-style and pattern mining. - **Out-of-scope:** training models evaluated on HumanEval/MBPP without contamination checks; production use without reviewing the per-file licenses of redistributed snippets. _Federated dataset: 10 parquet shards, 1.69 GB total. Queries and downloads stream through the DataBazaar API._ _PII signals: cc_shape×10 (Luhn-valid: 0), email×3, us_phone×17 present in the sample. Common in public datasets (papers, logs) but worth knowing before joining with private data._ Original supplier listing: CodeParrot Clean — Deduplicated Python Code from GitHub Cleaned, deduplicated corpus of Python files scraped from GitHub. Filtered for line length, alphanumeric fraction, and auto-generated content. Widely used for code LM pretraining and fine-tuning.

Schema

NameTypeDescription
repo_nameVARCHARGitHub repository identifier in owner/repo format
pathVARCHARFile path within the repository
copiesVARCHARNumber of near-duplicate copies detected before deduplication
sizeVARCHARFile size in bytes
contentVARCHARRaw Python source code
licenseVARCHARDetected license of the source repository
hashBIGINTContent hash used for deduplication
line_meanDOUBLEAverage line length in characters
line_maxBIGINTMaximum line length in characters
alpha_fracDOUBLEFraction of alphanumeric characters in the file (0.0–1.0)
autogeneratedBOOLEANBoolean flag indicating heuristic detection of autogenerated code

Sample Data

Preview a sample of the data before downloading.

Public sample only. Sign in to retrieve the full dataset, including free datasets.

For AI Agents

Via MCP Server
# 1. Add to your agent's MCP config (claude_desktop_config.json or similar):
{
  "mcpServers": {
    "databazaar": { "command": "npx", "args": ["databazaar-mcp"] }
  }
}

# 2. Your agent can then call:
search_datasets({ query: "CodeParrot Clean — Deduplicate" })
// Found: 4b6d4631-e372-4ac9-80ce-30489f8d8e00
get_download_url({ dataset_id: "4b6d4631-e372-4ac9-80ce-30489f8d8e00" })  // free — sign in with MCP OAuth first
Via REST API
# Free dataset — sign in or use your account API key:
curl https://api.databazaar.io/datasets/4b6d4631-e372-4ac9-80ce-30489f8d8e00/download-url -H "Authorization: Bearer $DATABAZAAR_API_KEY"