|
Download README.md from deepgit/github_meta: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/datasets/deepgit/github_meta/resolve/main/README.md
- Command line
-
hf download hf://datasets/deepgit/github_meta/README.md
-
curl -L -o README.md https://huggingface.co/datasets/deepgit/github_meta/resolve/main/README.md
1.35 kB
| license: osl-3.0 | |
| # Process to Generate DuckDB Dataset | |
| ## 1. Load Repository Metadata | |
| - Read `repo_metadata.json` from [GitHub Public Repository Metadata](https://www.kaggle.com/datasets/pelmers/github-repository-metadata-with-5-stars/data) | |
| - Normalize JSON into three lists: | |
| - **Repositories** → general metadata (stars, forks, license, etc.). | |
| - **Languages** → repo-language mappings with size. | |
| - **Topics** → repo-topic mappings. | |
| - Convert lists into Pandas DataFrames: `df_repos`, `df_languages`, `df_topics`. | |
| ## 2. Enhance with BigQuery Data | |
| - Create a temporary BigQuery table (`repo_list`) containing repository names. | |
| - Query **GitHub Archive (`githubarchive.month.2024*`)**: | |
| - Collect contributors from `PullRequestEvent`. | |
| - Collect stargazers from `WatchEvent`. | |
| - Merge BigQuery results back into `df_repos`. | |
| ## 3. Preprocess for DuckDB | |
| - Aggregate topics by repository: | |
| - Join multiple topics into a single pipe-separated string. | |
| - Create `df_topics_agg`. | |
| ## 4. Write to DuckDB | |
| - Connect to DuckDB using **SQLAlchemy**. | |
| - Write DataFrames into DuckDB: | |
| - `repos` → enriched repository metadata. | |
| - `repo_languages` → repo-language relations. | |
| - `repo_topics` → aggregated topics. | |
| - Add index on `repo_topics.topics` for faster querying: | |
| ```sql | |
| CREATE INDEX topic_idx ON repo_topics (topics); | |