yilinxia commited on
Commit
a39ec68
·
verified ·
1 Parent(s): 389fc8d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -3
README.md CHANGED
@@ -1,3 +1,34 @@
1
- ---
2
- license: osl-3.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: osl-3.0
3
+ ---
4
+ # Process to Generate DuckDB Dataset
5
+
6
+ ## 1. Load Repository Metadata
7
+ - Read `repo_metadata.json` from [GitHub Public Repository Metadata](https://www.kaggle.com/datasets/pelmers/github-repository-metadata-with-5-stars/data)
8
+ - Normalize JSON into three lists:
9
+ - **Repositories** → general metadata (stars, forks, license, etc.).
10
+ - **Languages** → repo-language mappings with size.
11
+ - **Topics** → repo-topic mappings.
12
+ - Convert lists into Pandas DataFrames: `df_repos`, `df_languages`, `df_topics`.
13
+
14
+ ## 2. Enhance with BigQuery Data
15
+ - Create a temporary BigQuery table (`repo_list`) containing repository names.
16
+ - Query **GitHub Archive (`githubarchive.month.2024*`)**:
17
+ - Collect contributors from `PullRequestEvent`.
18
+ - Collect stargazers from `WatchEvent`.
19
+ - Merge BigQuery results back into `df_repos`.
20
+
21
+ ## 3. Preprocess for DuckDB
22
+ - Aggregate topics by repository:
23
+ - Join multiple topics into a single pipe-separated string.
24
+ - Create `df_topics_agg`.
25
+
26
+ ## 4. Write to DuckDB
27
+ - Connect to DuckDB using **SQLAlchemy**.
28
+ - Write DataFrames into DuckDB:
29
+ - `repos` → enriched repository metadata.
30
+ - `repo_languages` → repo-language relations.
31
+ - `repo_topics` → aggregated topics.
32
+ - Add index on `repo_topics.topics` for faster querying:
33
+ ```sql
34
+ CREATE INDEX topic_idx ON repo_topics (topics);