Publish native Parquet dataset shard
Browse files- README.md +2 -2
- data/README.md +4 -2
- data/resources.parquet +3 -0
- meta/hf_card_body.md +1 -1
- meta/hf_card_header.yaml +1 -1
- scripts/build_hf_parquet.py +59 -0
README.md
CHANGED
|
@@ -28,7 +28,7 @@ configs:
|
|
| 28 |
- config_name: resources
|
| 29 |
data_files:
|
| 30 |
- split: train
|
| 31 |
-
path: data/resources.
|
| 32 |
---
|
| 33 |
|
| 34 |
<p align="center">
|
|
@@ -122,7 +122,7 @@ The complete [Future Directions agenda](https://github.com/ChaoYue0307/awesome-l
|
|
| 122 |
|
| 123 |
## Dataset Structure
|
| 124 |
|
| 125 |
-
The primary configuration is `resources`, with one `train` split backed by `data/resources.
|
| 126 |
|
| 127 |
| Field group | Fields | What it describes |
|
| 128 |
| --- | --- | --- |
|
|
|
|
| 28 |
- config_name: resources
|
| 29 |
data_files:
|
| 30 |
- split: train
|
| 31 |
+
path: data/resources.parquet
|
| 32 |
---
|
| 33 |
|
| 34 |
<p align="center">
|
|
|
|
| 122 |
|
| 123 |
## Dataset Structure
|
| 124 |
|
| 125 |
+
The primary configuration is `resources`, with one `train` split backed by the native `data/resources.parquet` shard. `data/resources.jsonl` and `data/resources.csv` contain the same rows for streaming, spreadsheet, and dataframe workflows.
|
| 126 |
|
| 127 |
| Field group | Fields | What it describes |
|
| 128 |
| --- | --- | --- |
|
data/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
| 3 |
Download deterministic tabular exports of all 545 source-audited resources.
|
| 4 |
|
| 5 |
- `resources.csv` - Tabular export for spreadsheets and ad hoc analysis.
|
| 6 |
-
- `resources.jsonl` - JSON Lines export
|
|
|
|
| 7 |
- `../docs/assets/resources.json` - Slim generated payload used by the website's searchable Resource Atlas.
|
| 8 |
- `first_seen.json` - Forward-only sidecar mapping resource URL to the date it was first added; the export left-joins it into the `date_added` column. Empty `date_added` means the entry predates per-entry tracking (started 2026-07-15).
|
| 9 |
- `resource_source_audit.csv` - Retrieval-time audit of every row, including URL status, source title metadata, arXiv IDs, and GitHub repository stats where available.
|
|
@@ -69,6 +70,7 @@ Build the focused Hugging Face dataset card for a staging mirror with:
|
|
| 69 |
|
| 70 |
```sh
|
| 71 |
python3 scripts/build_hf_card.py --output /tmp/awesome-loop-engineering-hf/README.md
|
|
|
|
| 72 |
```
|
| 73 |
|
| 74 |
-
The card is generated from `meta/hf_card_header.yaml`, `meta/hf_card_body.md`, the current dataset, and `CITATION.cff`. The YAML front matter is intentionally Hugging Face-only and must not be added to the GitHub README.
|
|
|
|
| 3 |
Download deterministic tabular exports of all 545 source-audited resources.
|
| 4 |
|
| 5 |
- `resources.csv` - Tabular export for spreadsheets and ad hoc analysis.
|
| 6 |
+
- `resources.jsonl` - JSON Lines export and source for the Hugging Face Parquet build.
|
| 7 |
+
- `resources.parquet` - Native Parquet shard generated in the Hugging Face release snapshot; it powers the Dataset Viewer without relying on server-side conversion.
|
| 8 |
- `../docs/assets/resources.json` - Slim generated payload used by the website's searchable Resource Atlas.
|
| 9 |
- `first_seen.json` - Forward-only sidecar mapping resource URL to the date it was first added; the export left-joins it into the `date_added` column. Empty `date_added` means the entry predates per-entry tracking (started 2026-07-15).
|
| 10 |
- `resource_source_audit.csv` - Retrieval-time audit of every row, including URL status, source title metadata, arXiv IDs, and GitHub repository stats where available.
|
|
|
|
| 70 |
|
| 71 |
```sh
|
| 72 |
python3 scripts/build_hf_card.py --output /tmp/awesome-loop-engineering-hf/README.md
|
| 73 |
+
python3 scripts/build_hf_parquet.py --output /tmp/awesome-loop-engineering-hf/data/resources.parquet
|
| 74 |
```
|
| 75 |
|
| 76 |
+
The card is generated from `meta/hf_card_header.yaml`, `meta/hf_card_body.md`, the current dataset, and `CITATION.cff`. The Parquet shard is a lossless derivative of `data/resources.jsonl` and requires `pyarrow`. The YAML front matter is intentionally Hugging Face-only and must not be added to the GitHub README.
|
data/resources.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d363995d9a67d48c8ae194ba6fb34d362b116a7391019c8c9194efe564abbbf2
|
| 3 |
+
size 435293
|
meta/hf_card_body.md
CHANGED
|
@@ -89,7 +89,7 @@ The complete [Future Directions agenda](https://github.com/ChaoYue0307/awesome-l
|
|
| 89 |
|
| 90 |
## Dataset Structure
|
| 91 |
|
| 92 |
-
The primary configuration is `resources`, with one `train` split backed by `data/resources.
|
| 93 |
|
| 94 |
| Field group | Fields | What it describes |
|
| 95 |
| --- | --- | --- |
|
|
|
|
| 89 |
|
| 90 |
## Dataset Structure
|
| 91 |
|
| 92 |
+
The primary configuration is `resources`, with one `train` split backed by the native `data/resources.parquet` shard. `data/resources.jsonl` and `data/resources.csv` contain the same rows for streaming, spreadsheet, and dataframe workflows.
|
| 93 |
|
| 94 |
| Field group | Fields | What it describes |
|
| 95 |
| --- | --- | --- |
|
meta/hf_card_header.yaml
CHANGED
|
@@ -28,5 +28,5 @@ configs:
|
|
| 28 |
- config_name: resources
|
| 29 |
data_files:
|
| 30 |
- split: train
|
| 31 |
-
path: data/resources.
|
| 32 |
---
|
|
|
|
| 28 |
- config_name: resources
|
| 29 |
data_files:
|
| 30 |
- split: train
|
| 31 |
+
path: data/resources.parquet
|
| 32 |
---
|
scripts/build_hf_parquet.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Build the native Parquet shard published by the Hugging Face mirror."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import argparse
|
| 7 |
+
import json
|
| 8 |
+
import sys
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
ROOT = Path(__file__).resolve().parents[1]
|
| 13 |
+
DEFAULT_INPUT = ROOT / "data" / "resources.jsonl"
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def main() -> int:
|
| 17 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 18 |
+
parser.add_argument("--input", type=Path, default=DEFAULT_INPUT, help="source JSON Lines export")
|
| 19 |
+
parser.add_argument("--output", type=Path, required=True, help="destination Parquet shard")
|
| 20 |
+
args = parser.parse_args()
|
| 21 |
+
|
| 22 |
+
try:
|
| 23 |
+
import pyarrow.json as arrow_json
|
| 24 |
+
import pyarrow.parquet as parquet
|
| 25 |
+
except ModuleNotFoundError:
|
| 26 |
+
print("pyarrow is required: python3 -m pip install pyarrow", file=sys.stderr)
|
| 27 |
+
return 1
|
| 28 |
+
|
| 29 |
+
expected_rows = sum(1 for line in args.input.read_text(encoding="utf-8").splitlines() if line.strip())
|
| 30 |
+
table = arrow_json.read_json(args.input)
|
| 31 |
+
if table.num_rows != expected_rows:
|
| 32 |
+
print(f"expected {expected_rows} rows, parsed {table.num_rows}", file=sys.stderr)
|
| 33 |
+
return 1
|
| 34 |
+
|
| 35 |
+
args.output.parent.mkdir(parents=True, exist_ok=True)
|
| 36 |
+
parquet.write_table(
|
| 37 |
+
table,
|
| 38 |
+
args.output,
|
| 39 |
+
compression="zstd",
|
| 40 |
+
use_dictionary=True,
|
| 41 |
+
write_statistics=True,
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
metadata = parquet.read_metadata(args.output)
|
| 45 |
+
if metadata.num_rows != expected_rows or metadata.num_columns != len(table.column_names):
|
| 46 |
+
print("written Parquet metadata does not match the source table", file=sys.stderr)
|
| 47 |
+
return 1
|
| 48 |
+
|
| 49 |
+
summary = {
|
| 50 |
+
"columns": metadata.num_columns,
|
| 51 |
+
"output": str(args.output),
|
| 52 |
+
"rows": metadata.num_rows,
|
| 53 |
+
}
|
| 54 |
+
print(json.dumps(summary, sort_keys=True))
|
| 55 |
+
return 0
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
if __name__ == "__main__":
|
| 59 |
+
raise SystemExit(main())
|