File size: 1,832 Bytes
817078c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83d01da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
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
  splits:
  - name: train
    num_bytes: 360682958
    num_examples: 45001
  - name: validation
    num_bytes: 37445138
    num_examples: 5000
  download_size: 141557496
  dataset_size: 398128096
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: validation
    path: data/validation-*
---

# ๐Ÿ CodeParrot Python Only

This dataset contains **Python-only source code** extracted from the larger [CodeParrot](https://huggingface.co/datasets/codeparrot) corpus. It includes high-quality `.py` files filtered from public GitHub repositories and curated for use in training large language models (LLMs) on Python code generation tasks.

## ๐Ÿ“ฆ Dataset Summary

- โœ… Filtered to include **only Python code**
- ๐Ÿงน Cleaned to remove non-source content (e.g., binaries, notebooks, scripts with mixed languages)
- ๐Ÿง  Ideal for training or evaluating code generation models
- ๐Ÿงพ Each entry is a code snippet or full Python file stored as raw text

## ๐Ÿ’ก Use Cases

This dataset is best suited for:

- Training/fine-tuning LLMs for:
  - Python code generation
  - Auto-completion
  - Bug detection
  - Code summarization
- Evaluating code-specific capabilities of general LLMs
- Research in code intelligence, representation learning, and software engineering

## ๐Ÿ“ Example Format

Each record is a single code block:

```json
{
  "code": "def hello_world():\n    print('Hello, world!')"
}
```

๐Ÿš€ How to Use

```
from datasets import load_dataset

ds = load_dataset("theothertom/codeparrot-python-only")
print(ds["train"][0]["code"])
```