Datasets#
Daft provides simple, performant, and responsible ways to access useful datasets like Common Crawl and DROID.
Common Crawl#
Check out our Common Crawl dataset guide for more examples!
common_crawl #
common_crawl(crawl: str, segment: str | None = None, content: Literal['raw', 'text', 'metadata', 'warc', 'wet', 'wat'] = 'raw', num_files: int | None = None, io_config: IOConfig | None = None, *, in_aws: bool = False, source: Literal['s3', 'hf', 'http'] | None = None) -> DataFrame
Load Common Crawl data as a DataFrame.
This function automatically resolves the specified crawl and segment into the appropriate Common Crawl files and loads them as a DataFrame, handling the WARC reading process internally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
crawl | str | The crawl identifier, e.g. "CC-MAIN-2025-33". | required |
segment | str | None | Specific segment to fetch within the crawl. If not provided, defaults to all segments in the crawl. | None |
content | Literal['raw', 'text', 'metadata', 'warc', 'wet', 'wat'] | Specifies the type of content to load. Options are: + "raw" or "warc": Raw WARC files containing full HTTP responses + "text" or "wet": Extracted plain text content + "metadata" or "wat": Metadata about crawled pages | 'raw' |
num_files | int | None | Limit the number of files to process. If not provided, processes all matching files. | None |
io_config | IOConfig | None | IO configuration for accessing storage. | None |
in_aws | bool | DEPRECATED - please use | False |
source | Literal['s3', 'hf', 'http'] | None | Source of the Common Crawl data. Options are: + "s3": AWS S3 + "hf": HuggingFace + "http": HTTP + None: Automatically chooses HuggingFace if the crawl is available, otherwise uses HTTP. S3 is an explicit choice due to S3 egress fees. | None |
Returns:
| Type | Description |
|---|---|
DataFrame | A DataFrame containing the requested Common Crawl data. |
Examples:
1 2 | |
╭────────────────┬─────────────────┬───────────┬────────────────────┬────────────┬────────────────────┬──────────────┬──────────────╮
│ WARC-Record-ID ┆ WARC-Target-URI ┆ WARC-Type ┆ WARC-Date ┆ … ┆ WARC-Identified-Pa ┆ warc_content ┆ warc_headers │
│ --- ┆ --- ┆ --- ┆ --- ┆ ┆ yload-Type ┆ --- ┆ --- │
│ String ┆ String ┆ String ┆ Timestamp[ns, ┆ (1 hidden) ┆ --- ┆ Binary ┆ String │
│ ┆ ┆ ┆ "Etc/UTC"] ┆ ┆ String ┆ ┆ │
╰────────────────┴─────────────────┴───────────┴────────────────────┴────────────┴────────────────────┴──────────────┴──────────────╯
(No data to display: Dataframe not materialized, use .collect() to materialize) 1 2 | |
╭─────────────────┬─────────────────┬────────────┬─────────────────┬────────────┬─────────────────┬────────────────┬────────────────╮
│ WARC-Record-ID ┆ WARC-Target-URI ┆ WARC-Type ┆ WARC-Date ┆ … ┆ WARC-Identified ┆ warc_content ┆ warc_headers │
│ --- ┆ --- ┆ --- ┆ --- ┆ ┆ -Payload-Type ┆ --- ┆ --- │
│ String ┆ String ┆ String ┆ Timestamp[ns ┆ (1 hidden) ┆ --- ┆ Binary ┆ String │
│ ┆ ┆ ┆ "Etc/UTC"] ┆ ┆ String ┆ ┆ │
╞═════════════════╪═════════════════╪════════════╪═════════════════╪════════════╪═════════════════╪════════════════╪════════════════╡
│ 0cb039e8-d357-4 ┆ None ┆ warcinfo ┆ 2025-08-16 ┆ … ┆ None ┆ b"Software-Inf ┆ {"Content-Type │
│ 85f-95dd-cdfdb… ┆ ┆ ┆ 01:03:20 UTC ┆ ┆ ┆ o: ┆ ":"application │
│ ┆ ┆ ┆ ┆ ┆ ┆ ia-web-commo… ┆ /… │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ af55e6ef-eeda-4 ┆ http://010ganji ┆ conversion ┆ 2025-08-02 ┆ … ┆ None ┆ b"ETF\xe9\x80\ ┆ {"Content-Type │
│ bf7-a599-581bc… ┆ .com/html/ying… ┆ ┆ 23:06:24 UTC ┆ ┆ ┆ x89\xe6\x8b\xa ┆ ":"text/plain" │
│ ┆ ┆ ┆ ┆ ┆ ┆ 9… ┆ ,… │
╰─────────────────┴─────────────────┴────────────┴─────────────────┴────────────┴─────────────────┴────────────────┴────────────────╯
(Showing first 2 of 2 rows) 1 2 3 4 | |
╭─────────────────┬─────────────────┬───────────┬─────────────────┬────────────┬─────────────────┬─────────────────┬────────────────╮
│ WARC-Record-ID ┆ WARC-Target-URI ┆ WARC-Type ┆ WARC-Date ┆ … ┆ WARC-Identified ┆ warc_content ┆ warc_headers │
│ --- ┆ --- ┆ --- ┆ --- ┆ ┆ -Payload-Type ┆ --- ┆ --- │
│ String ┆ String ┆ String ┆ Timestamp[ns ┆ (1 hidden) ┆ --- ┆ Binary ┆ String │
│ ┆ ┆ ┆ "Etc/UTC"] ┆ ┆ String ┆ ┆ │
╞═════════════════╪═════════════════╪═══════════╪═════════════════╪════════════╪═════════════════╪═════════════════╪════════════════╡
│ b6238b9c-8db0-4 ┆ None ┆ warcinfo ┆ 2025-08-15 ┆ … ┆ None ┆ b"isPartOf: CC- ┆ {"Content-Type │
│ 5ac-a6ef-c3cb0… ┆ ┆ ┆ 20:42:38 UTC ┆ ┆ ┆ MAIN-2025-33\r… ┆ ":"application │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ /… │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ b29da11b-5976-4 ┆ http://0.woxav. ┆ request ┆ 2025-08-15 ┆ … ┆ None ┆ b"GET /forum-12 ┆ {"Content-Type │
│ f3b-82c4-71fdd… ┆ com/forum-120-… ┆ ┆ 22:33:40 UTC ┆ ┆ ┆ 0-1.html HTTP/… ┆ ":"application │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ /… │
╰─────────────────┴─────────────────┴───────────┴─────────────────┴────────────┴─────────────────┴─────────────────┴────────────────╯
(Showing first 2 of 2 rows) Source code in daft/datasets/common_crawl.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
LeRobot v3#
See the LeRobot v3 dataset guide for episode vs frame workflows and Hub/local paths.
read #
read(dataset_uri: str, io_config: IOConfig | None = None, include_stats: bool = False, load_video_frames: str | list[str] | bool = False) -> DataFrame
Read a LeRobot v3 dataset as a lazy DataFrame with one row per frame.
Reads the per-episode metadata under meta/episodes and the per-frame sensor data under data, joins them on episode_index, and broadcasts each episode's metadata across its frames. Optionally decodes the matching video frame for one or more camera keys into an image column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_uri | str | Huggingface repo id ( | required |
io_config | IOConfig | None | Optional IO configuration for remote reads. | None |
include_stats | bool | If True, keep the per-episode | False |
load_video_frames | str | list[str] | bool | Which camera keys to decode into image columns, aligned to each frame's timestamp. Defaults to False (decode nothing). Pass True to decode every video feature, a single key ( | False |
Returns:
| Type | Description |
|---|---|
DataFrame | Lazy DataFrame with one row per frame: the frame's sensor columns, the |
DataFrame | broadcast episode metadata, and one image column per decoded video key. |
Source code in daft/datasets/lerobot.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | |
read_episodes #
read_episodes(dataset_uri: str, io_config: IOConfig | None = None, include_meta: bool = False, include_stats: bool = False, include_video_metadata: bool = False) -> DataFrame
Read LeRobot v3 episode metadata as a lazy DataFrame (one row per episode).
This reads the meta/episodes/**/*.parquet path under the dataset root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_uri | str | Huggingface repo id ( | required |
io_config | IOConfig | None | Optional IO configuration for remote reads. | None |
include_meta | bool | If True, keep the internal | False |
include_stats | bool | If True, keep the per-episode | False |
include_video_metadata | bool | If True, keep the per-episode | False |
Returns:
| Type | Description |
|---|---|
DataFrame | Lazy DataFrame of episode metadata, one row per episode. Always includes |
DataFrame | a |
DataFrame |
|
Source code in daft/datasets/lerobot.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | |
load_episode_frames #
load_episode_frames(episodes: DataFrame, dataset_uri: str, io_config: IOConfig | None = None) -> DataFrame
Expand an episode-level DataFrame into a frame-level DataFrame.
Reads the per-frame parquet under data/** and joins it to the provided episode metadata on episode_index, producing one row per frame. Episode metadata is broadcast across each episode's frames.
Filter episodes before calling this to expand only the episodes you need; only the surviving episodes contribute to the join.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
episodes | DataFrame | Episode-level DataFrame, typically from :func: | required |
dataset_uri | str | The same dataset identifier passed to :func: | required |
io_config | IOConfig | None | Optional IO configuration for remote reads. | None |
Returns:
| Type | Description |
|---|---|
DataFrame | Lazy DataFrame with one row per frame. |
Source code in daft/datasets/lerobot.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | |
read_tasks #
Load task metadata as a DataFrame.
Prefers meta/tasks.parquet (current LeRobot default). Falls back to legacy meta/tasks.jsonl when the Parquet file is missing.
Source code in daft/datasets/lerobot.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 | |
DROID#
Check out our DROID dataset guide for more examples!
raw #
Load the raw DROID robotics dataset as a lazy episode-level DataFrame.
This function discovers episodes by globbing metadata_*.json files under the provided dataset root, reads the episode metadata, and attaches lazy file references to the per-episode trajectory HDF5 file and MP4 camera recordings.
Note
The public dataset is missing camera recordings for some episodes. Those that are missing will be set to None. Additionally, to read the test or train split only, specify a more restricted glob path such as: - gs://gresearch/robotics/droid_raw/test/**/metadata_*.json - gs://gresearch/robotics/droid_raw/train/**/metadata_*.json
The default is gs://gresearch/robotics/droid_raw/**/metadata_*.json.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Root path to the raw DROID dataset. Defaults to the official public GCS release at | _PUBLIC_GCS_BUCKET |
io_config | IOConfig | None | IO configuration for accessing remote storage. | None |
Returns:
| Type | Description |
|---|---|
DataFrame | A DataFrame with one row per episode. Metadata fields from each episode's JSON |
DataFrame | file are unnested into top-level columns, along with: |
DataFrame |
|
DataFrame |
|
DataFrame |
|
DataFrame |
|
DataFrame |
|
Examples:
1 2 3 | |
Source code in daft/datasets/droid.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
scenes #
Load the DROID scene classification table as a lazy DataFrame.
The table maps DROID scene_id values to GPT-4V scene_classification labels. Join it onto episode-level DataFrames from :func:raw or :func:trajectory when you need scene labels.
Note
This helper uses a copy of the original file hosted on Hugging Face datasets. Keeping this classification table in sync is best-effort and may not be up-to-date. See https://huggingface.co/datasets/Eventual-Inc/droid-scene-classifications for mirror details and original source attribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
io_config | IOConfig | None | IO configuration for reading the Hugging Face classification table. | None |
Returns:
| Type | Description |
|---|---|
DataFrame | A DataFrame with |
Examples:
1 2 3 4 5 | |
Source code in daft/datasets/droid.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
trajectory #
Read selected trajectory datasets from episode-level HDF5 files.
This helper takes the lazy episode catalog produced by :func:raw and adds tensor columns for the requested HDF5 datasets. Each output row still corresponds to one episode; use filters such as limit on episodes before calling this function to avoid reading more data than needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
episodes | DataFrame | Episode-level DataFrame from :func: | required |
fields | Sequence[str] | HDF5 dataset paths to read, such as | _DEFAULT_TRAJECTORY_FIELDS |
Returns:
| Type | Description |
|---|---|
DataFrame | The input DataFrame with one tensor column per requested field. Rows with |
DataFrame | a null |
Examples:
1 2 3 4 5 6 7 8 | |
Source code in daft/datasets/droid.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | |
camera_frames #
camera_frames(episodes: DataFrame, cameras: str | Sequence[str] = ('wrist', 'ext1', 'ext2'), *, start_time: float = 0, end_time: float | None = None, width: int | None = None, height: int | None = None, is_key_frame: bool | None = None, sample_interval_seconds: float | None = None) -> DataFrame
Decode DROID camera videos into per-episode frame-list columns.
This helper takes an episode-level DataFrame from raw or trajectory and appends one frame-list column per requested camera. It keeps one row per episode; each frame-list column contains the structs returned by :func:daft.functions.video_frames, including frame metadata and image data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
episodes | DataFrame | Episode-level DataFrame containing DROID camera | required |
cameras | str | Sequence[str] | Camera or cameras to decode. May be a single camera string or a sequence of camera names. Supported values are | ('wrist', 'ext1', 'ext2') |
start_time | float | Start of the time range in seconds. Defaults to 0. | 0 |
end_time | float | None | End of the time range in seconds. Defaults to None, meaning all frames. | None |
width | int | None | Target width for resizing frames. Must be provided with | None |
height | int | None | Target height for resizing frames. Must be provided with | None |
is_key_frame | bool | None | If True, decode only keyframes. If False, decode only non-keyframes. If None, decode all frames. | None |
sample_interval_seconds | float | None | If provided, sample frames at approximately this time interval in seconds. | None |
Returns:
| Type | Description |
|---|---|
DataFrame | The input DataFrame with |
Examples:
1 2 3 4 5 | |
Source code in daft/datasets/droid.py
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 | |