1
1
---
2
- title : pyOpenSci Package Metrics Over Time
2
+ title : pyOpenSci Package Metrics
3
3
jupyter : python3
4
4
execute :
5
5
echo : false
6
6
---
7
7
8
- This data provides metrics accross all the PyOpenSci packages.
8
+ This data provides metrics accross PyOpenSci packages.
9
9
10
10
``` {python}
11
11
#| echo: false
@@ -38,35 +38,101 @@ package_data_path = Path.cwd().parents[0] / "_data" / "package_data.csv"
38
38
39
39
# Read the DataFrame from the CSV file
40
40
package_df = pd.read_csv(package_data_path)
41
- ```
42
-
43
- ### Forks count per repositories
44
41
45
- ``` {python}
46
42
# Parse the "gh_meta" column back into dictionaries
47
43
package_df['gh_meta'] = package_df['gh_meta'].apply(
48
44
lambda x: ast.literal_eval(x) if isinstance(x, str) else x
49
45
)
46
+ ```
47
+
48
+ ### Forks
50
49
50
+ ``` {python}
51
51
# Extract "forks_count" value from the 'gh_meta' column
52
52
package_df['forks_count'] = package_df['gh_meta'].apply(
53
- lambda x: x.get('forks_count') if isinstance(x, dict) else None
53
+ lambda x: x.get('forks_count'
54
+ ) if isinstance(x, dict) else None
55
+ )
56
+ ```
57
+
58
+ ``` {python}
59
+ # Render a graph plot of the fork count
60
+ chart = (
61
+ alt.Chart(package_df).mark_bar(color="#81c0aa")
62
+ .encode(
63
+ alt.X('package_name', sort='-y')
64
+ .title('Package name')
65
+ .axis(labelAngle=45),
66
+ alt.Y('forks_count:Q')
67
+ .title('Fork count'),
68
+ )
69
+ .properties(title="Number of forks per repository")
70
+ .configure_legend(
71
+ orient='top',
72
+ titleAnchor='middle',
73
+ direction='horizontal',
74
+ labelFontSize=5,
75
+ )
76
+ .interactive()
77
+ )
78
+
79
+ chart
80
+ ```
81
+
82
+ ### Contributors
83
+
84
+ ``` {python}
85
+ # Extract "contrib_count" value from the 'gh_meta' column
86
+ package_df['contrib_count'] = package_df['gh_meta'].apply(
87
+ lambda x: x.get('contrib_count') if isinstance(x, dict) else None
88
+ )
89
+ ```
90
+
91
+ ``` {python}
92
+ # Render a graph plot of contributor count
93
+ chart = (
94
+ alt.Chart(package_df).mark_bar(color="#f47a78")
95
+ .encode(
96
+ alt.X('package_name', sort='-y')
97
+ .title('Package name')
98
+ .axis(labelAngle=45),
99
+ alt.Y('contrib_count:Q')
100
+ .title('Contributor count'),
101
+ )
102
+ .properties(title="Number of contributors per repository")
103
+ .configure_legend(
104
+ orient='top',
105
+ titleAnchor='middle',
106
+ direction='horizontal',
107
+ labelFontSize=5,
108
+ )
109
+ .interactive()
54
110
)
111
+
112
+ chart
55
113
```
56
114
115
+ ### Open issues
116
+
117
+ ``` {python}
118
+ # Extract "open_issues_count" value from the 'gh_meta' column
119
+ package_df['open_issues_count'] = package_df['gh_meta'].apply(
120
+ lambda x: x.get('open_issues_count') if isinstance(x, dict) else None
121
+ )
122
+ ```
57
123
58
124
``` {python}
59
- # Render a graph plot of the forks count
125
+ # Render a graph plot of open issue count
60
126
chart = (
61
- alt.Chart(package_df).mark_bar()
127
+ alt.Chart(package_df).mark_bar(color="#735fab" )
62
128
.encode(
63
- x= alt.X('package_name', sort='-y')
129
+ alt.X('package_name', sort='-y')
64
130
.title('Package name')
65
131
.axis(labelAngle=45),
66
- y= alt.Y('forks_count :Q')
67
- .title('Forks Count '),
132
+ alt.Y('open_issues_count :Q')
133
+ .title('Open issues count '),
68
134
)
69
- .properties(title="Forks Count per Repository ")
135
+ .properties(title="Number of open issues per repository ")
70
136
.configure_legend(
71
137
orient='top',
72
138
titleAnchor='middle',
@@ -79,12 +145,51 @@ chart = (
79
145
chart
80
146
```
81
147
148
+ ### Stargazers
149
+
150
+ ``` {python}
151
+ # Extract "stargazers_count" value from the 'gh_meta' column
152
+ package_df['stargazers_count'] = package_df['gh_meta'].apply(
153
+ lambda x: x.get('stargazers_count') if isinstance(x, dict) else None
154
+ )
155
+ ```
156
+
157
+ ``` {python}
158
+ # Render a graph plot of stargazer count
159
+ chart = (
160
+ alt.Chart(package_df).mark_bar(color="#e8cd2a")
161
+ .encode(
162
+ alt.X('package_name', sort='-y')
163
+ .title('Package name')
164
+ .axis(labelAngle=45),
165
+ alt.Y('stargazers_count:Q')
166
+ .title('Stargazer count'),
167
+ )
168
+ .properties(title="Number of stargazers per repository")
169
+ .configure_legend(
170
+ orient='top',
171
+ titleAnchor='middle',
172
+ direction='horizontal',
173
+ labelFontSize=5,
174
+ )
175
+ .interactive()
176
+ )
177
+
178
+ chart
179
+ ```
180
+
181
+
182
+ ### Detailed PyOpenSci metrics
183
+
82
184
Find bellow the detailed count for each PyOpenSci repository.
83
185
84
186
``` {python}
85
187
# Create an itable to display the DataFrame
86
188
from itables import show
87
189
88
190
# Display the results as an interactive table
89
- show(package_df[['package_name', 'forks_count']], max_rows=10)
90
- ```
191
+ show(
192
+ package_df[['package_name', 'forks_count', 'contrib_count', 'open_issues_count', 'stargazers_count']],
193
+ max_rows=10
194
+ )
195
+ ```
0 commit comments