Created
November 1, 2019 19:39
-
-
Save daltonpearson/ed6e1f7649614fa45354802b677d8607 to your computer and use it in GitHub Desktop.
No Overview Available: Overview by @thepythoneer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################## | |
# Dalton Pearson - 19/1/2019 # | |
# Twitter - @ThePythoneer # | |
# Python Version >= 3.6 # | |
# A script to generate # | |
# an overview from the data # | |
# at NoOverviewAvailable.com # | |
############################## | |
import urllib | |
from urllib import request | |
import xml.etree.ElementTree as ElementTree | |
URL = "https://nooverviewavailable.com/" | |
# How many of the worst documented libraries that you want to display, Supports negative indexing and can be set to None to show all | |
WORST_COUNT = None | |
def get_html(): | |
response = urllib.request.urlopen(URL) | |
html = response.read() | |
tree = ElementTree.fromstring(html) | |
return tree | |
def parse(tree): | |
rows = tree.findall('.//table[@id="frameworks"]/tbody/tr') | |
frameworks = list() | |
for row in rows: | |
name = row.find(".//th/a").text | |
meter = dict(row.find(".//td/figure/meter").items()) | |
framework = { | |
"value": int(meter["value"]), | |
"min": "0", | |
"max": int(meter["max"]), | |
"low": int(meter["low"]), | |
"high": int(meter["high"]), | |
"optimum": int(meter["optimum"]), | |
"name": name, | |
} | |
framework.update({"percent": framework["value"] / framework["max"] * 100}) | |
frameworks.append(framework) | |
return frameworks | |
def calculate_stats(frameworks): | |
stats = { | |
"value": sum([framework["value"] for framework in frameworks]), | |
"max": sum([framework["max"] for framework in frameworks]), | |
"high": sum( | |
[ | |
1 if framework["value"] > framework["high"] else 0 | |
for framework in frameworks | |
] | |
), | |
"medium": sum( | |
[ | |
1 if framework["high"] >= framework["value"] > framework["low"] else 0 | |
for framework in frameworks | |
] | |
), | |
"low": sum( | |
[ | |
1 if framework["low"] >= framework["value"] else 0 | |
for framework in frameworks | |
] | |
), | |
"frameworks": len(frameworks), | |
"worst": sorted(frameworks, key=lambda k: k["percent"])[:WORST_COUNT], | |
} | |
stats.update({"percent": stats["value"] / stats["max"] * 100}) | |
return stats | |
def display_string(stats): | |
symbols_documented = ( | |
f'Symbols Documented: {format_stat(stats["value"], stats["max"])}' | |
) | |
documentation_levels = f'Framework Documentation Level Totals:\n\tGood: {format_stat(stats["high"], stats["frameworks"])}\n\tPoor: {format_stat(stats["medium"], stats["frameworks"])}\n\tButterfly Keyboard Bad: {format_stat(stats["low"], stats["frameworks"])}' | |
worst_documented_list = "\n".join( | |
[ | |
f'\t{rank}. {framework["name"]}: {format_stat(framework["value"], framework["max"])}' | |
for rank, framework in enumerate(stats["worst"], start=1) | |
] | |
) | |
worst_documented = f"Worst Documented:\n{worst_documented_list}" | |
output = f"{symbols_documented}\n{documentation_levels}\n{worst_documented}" | |
return output | |
def format_stat(value, total): | |
return f"{value} of {total} ({(value/total * 100):.2f}%)" | |
if __name__ == "__main__": | |
html_tree = get_html() | |
frameworks = parse(html_tree) | |
stats = calculate_stats(frameworks) | |
output = display_string(stats) | |
print(output) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################## | |
# Dalton Pearson - 19/1/2019 # | |
# Twitter - @ThePythoneer # | |
############################## | |
Symbols Documented: 138216 of 219383 (63.00%) | |
Framework Documentation Level Totals: | |
Good: 76 of 180 (42.22%) | |
Poor: 75 of 180 (41.67%) | |
Butterfly Keyboard Bad: 29 of 180 (16.11%) | |
Worst Documented: | |
1. ColorSync: 0 of 3 (0.00%) | |
2. ExecutionPolicy: 0 of 19 (0.00%) | |
3. GSS: 0 of 248 (0.00%) | |
4. HIDDriverKit: 0 of 4 (0.00%) | |
5. IOUSBHost: 0 of 123 (0.00%) | |
6. NetworkingDriverKit: 0 of 269 (0.00%) | |
7. USBDriverKit: 0 of 191 (0.00%) | |
8. simd: 24 of 3144 (0.76%) | |
9. OpenGL ES: 23 of 964 (2.39%) | |
10. WebKit JS: 204 of 3941 (5.18%) | |
11. Kernel: 2339 of 28782 (8.13%) | |
12. IOBluetooth: 367 of 3894 (9.42%) | |
13. Core Audio: 124 of 618 (20.06%) | |
14. IOKit: 92 of 455 (20.22%) | |
15. FWAUserLib: 112 of 547 (20.48%) | |
16. Hypervisor: 103 of 408 (25.25%) | |
17. Metal Performance Shaders: 701 of 2767 (25.33%) | |
18. Create ML: 8 of 26 (30.77%) | |
19. Core Services: 1457 of 4678 (31.15%) | |
20. EndpointSecurity: 1 of 3 (33.33%) | |
21. ApplicationServices: 1261 of 3683 (34.24%) | |
22. WebKit: 789 of 2171 (36.34%) | |
23. Core Audio Kit: 17 of 46 (36.96%) | |
24. SwiftUI: 4829 of 11901 (40.58%) | |
25. IOSurface: 61 of 147 (41.50%) | |
26. DriverKit: 4 of 9 (44.44%) | |
27. Image I/O: 346 of 756 (45.77%) | |
28. AudioToolbox: 1398 of 2857 (48.93%) | |
29. VideoToolbox: 162 of 318 (50.94%) | |
30. Core Media: 1128 of 2118 (53.26%) | |
31. QuickLook: 60 of 112 (53.57%) | |
32. DiskArbitration: 59 of 110 (53.64%) | |
33. Intents: 7 of 13 (53.85%) | |
34. RealityKit: 1144 of 1994 (57.37%) | |
35. vmnet: 32 of 51 (62.75%) | |
36. Game Controller: 155 of 235 (65.96%) | |
37. iTunesLibrary: 255 of 385 (66.23%) | |
38. Playground Support: 63 of 95 (66.32%) | |
39. OpenDirectory: 482 of 723 (66.67%) | |
40. Automator: 119 of 178 (66.85%) | |
41. Core Text: 499 of 745 (66.98%) | |
42. XCTest: 793 of 1180 (67.20%) | |
43. Model I/O: 581 of 864 (67.25%) | |
44. Combine: 7367 of 10930 (67.40%) | |
45. Security: 3557 of 5194 (68.48%) | |
46. ForceFeedback: 196 of 286 (68.53%) | |
47. FinderSync: 21 of 30 (70.00%) | |
48. IOBluetoothUI: 73 of 104 (70.19%) | |
49. PDFKit: 460 of 652 (70.55%) | |
50. SafariServices: 130 of 184 (70.65%) | |
51. Natural Language: 155 of 218 (71.10%) | |
52. AVKit: 177 of 242 (73.14%) | |
53. WatchConnectivity: 77 of 105 (73.33%) | |
54. CallKit: 167 of 227 (73.57%) | |
55. Core Image: 1268 of 1723 (73.59%) | |
56. iAd: 104 of 141 (73.76%) | |
57. Core MIDI: 530 of 710 (74.65%) | |
58. InputMethodKit: 81 of 108 (75.00%) | |
59. ReplayKit: 89 of 118 (75.42%) | |
60. NetworkExtension: 580 of 759 (76.42%) | |
61. Compression: 63 of 82 (76.83%) | |
62. LivePhotosKit JS: 40 of 52 (76.92%) | |
63. Core WLAN: 173 of 223 (77.58%) | |
64. JavaScriptCore: 229 of 293 (78.16%) | |
65. Core Data: 1376 of 1736 (79.26%) | |
66. Core Audio Types: 381 of 480 (79.38%) | |
67. Core Video: 364 of 456 (79.82%) | |
68. dnssd: 36 of 45 (80.00%) | |
69. EventKit: 528 of 652 (80.98%) | |
70. FileProviderUI: 13 of 16 (81.25%) | |
71. CloudKit: 975 of 1194 (81.66%) | |
72. SceneKit: 2451 of 2993 (81.89%) | |
73. os: 77 of 94 (81.91%) | |
74. PencilKit: 100 of 122 (81.97%) | |
75. Dispatch: 738 of 897 (82.27%) | |
76. Objective-C Runtime: 290 of 351 (82.62%) | |
77. MediaLibrary: 163 of 196 (83.16%) | |
78. Swift Package Manager: 163 of 195 (83.59%) | |
79. MediaAccessibility: 43 of 51 (84.31%) | |
80. XPC: 258 of 305 (84.59%) | |
81. Network: 1331 of 1561 (85.27%) | |
82. Foundation: 13650 of 15987 (85.38%) | |
83. Contacts: 338 of 392 (86.22%) | |
84. UserNotificationsUI: 19 of 22 (86.36%) | |
85. Core Graphics: 1878 of 2171 (86.50%) | |
86. Accelerate: 2749 of 3166 (86.83%) | |
87. Collaboration: 33 of 38 (86.84%) | |
88. DarwinNotify: 21 of 24 (87.50%) | |
89. ServiceManagement: 21 of 24 (87.50%) | |
90. AppKit: 17218 of 19677 (87.50%) | |
91. MultipeerConnectivity: 93 of 106 (87.74%) | |
92. ExternalAccessory: 72 of 82 (87.80%) | |
93. SystemConfiguration: 499 of 568 (87.85%) | |
94. GLKit: 431 of 490 (87.96%) | |
95. Accounts: 74 of 84 (88.10%) | |
96. FxPlug: 544 of 617 (88.17%) | |
97. Core Animation: 515 of 584 (88.18%) | |
98. AVFoundation: 6318 of 7163 (88.20%) | |
99. Core Motion: 217 of 244 (88.93%) | |
100. CryptoTokenKit: 233 of 261 (89.27%) | |
101. EventKitUI: 43 of 48 (89.58%) | |
102. Swift Standard Library: 10399 of 11595 (89.69%) | |
103. Core Spotlight: 263 of 293 (89.76%) | |
104. Core Foundation: 2213 of 2459 (90.00%) | |
105. Quartz: 677 of 752 (90.03%) | |
106. TVMLKit: 274 of 304 (90.13%) | |
107. SpriteKit: 1824 of 2017 (90.43%) | |
108. UIKit: 12220 of 13414 (91.10%) | |
109. FileProvider: 154 of 169 (91.12%) | |
110. Business Chat: 21 of 23 (91.30%) | |
111. Core ML: 244 of 266 (91.73%) | |
112. GameKit: 793 of 864 (91.78%) | |
113. CarPlay: 246 of 268 (91.79%) | |
114. LatentSemanticMapping: 59 of 64 (92.19%) | |
115. Apple CryptoKit: 643 of 697 (92.25%) | |
116. Safari Extensions JS: 192 of 208 (92.31%) | |
117. NotificationCenter: 50 of 54 (92.59%) | |
118. Sign in with Apple JS: 13 of 14 (92.86%) | |
119. CFNetwork: 427 of 457 (93.44%) | |
120. MetalKit: 203 of 217 (93.55%) | |
121. SystemExtensions: 58 of 62 (93.55%) | |
122. Core Telephony: 75 of 80 (93.75%) | |
123. DeviceCheck: 16 of 17 (94.12%) | |
124. GameplayKit: 625 of 664 (94.13%) | |
125. MessageUI: 50 of 53 (94.34%) | |
126. MetricKit: 94 of 99 (94.95%) | |
127. PassKit (Apple Pay and Wallet): 546 of 572 (95.45%) | |
128. PushKit: 22 of 23 (95.65%) | |
129. MusicKit JS: 232 of 242 (95.87%) | |
130. SoundAnalysis: 47 of 49 (95.92%) | |
131. AuthenticationServices: 235 of 243 (96.71%) | |
132. ExceptionHandling: 30 of 31 (96.77%) | |
133. UserNotifications: 381 of 393 (96.95%) | |
134. XcodeKit: 34 of 35 (97.14%) | |
135. StoreKit: 278 of 286 (97.20%) | |
136. AGL: 149 of 153 (97.39%) | |
137. MapKit: 1178 of 1209 (97.44%) | |
138. ScriptingBridge: 39 of 40 (97.50%) | |
139. TVMLKit JS: 209 of 214 (97.66%) | |
140. TVServices: 126 of 129 (97.67%) | |
141. ARKit: 1034 of 1056 (97.92%) | |
142. Media Player: 669 of 682 (98.09%) | |
143. AddressBook: 776 of 790 (98.23%) | |
144. QuickLookThumbnailing: 60 of 61 (98.36%) | |
145. AddressBookUI: 65 of 66 (98.48%) | |
146. Vision: 601 of 610 (98.52%) | |
147. SecurityInterface: 134 of 136 (98.53%) | |
148. WatchKit: 619 of 627 (98.72%) | |
149. Core Location: 548 of 555 (98.74%) | |
150. OSLog: 82 of 83 (98.80%) | |
151. Speech: 87 of 88 (98.86%) | |
152. AssetsLibrary: 111 of 112 (99.11%) | |
153. Metal: 3661 of 3684 (99.38%) | |
154. Core Bluetooth: 331 of 333 (99.40%) | |
155. HomeKit: 1011 of 1017 (99.41%) | |
156. Core Haptics: 197 of 198 (99.49%) | |
157. Core NFC: 437 of 439 (99.54%) | |
158. CloudKit JS: 286 of 287 (99.65%) | |
159. ClockKit: 320 of 321 (99.69%) | |
160. HealthKit: 1011 of 1013 (99.80%) | |
161. AdSupport: 5 of 5 (100.00%) | |
162. BackgroundTasks: 35 of 35 (100.00%) | |
163. Bundle Resources: 4 of 4 (100.00%) | |
164. ClassKit: 148 of 148 (100.00%) | |
165. ContactsUI: 41 of 41 (100.00%) | |
166. HealthKitUI: 3 of 3 (100.00%) | |
167. IntentsUI: 3 of 3 (100.00%) | |
168. LinkPresentation: 33 of 33 (100.00%) | |
169. LocalAuthentication: 97 of 97 (100.00%) | |
170. MapKit JS: 458 of 458 (100.00%) | |
171. Messages: 111 of 111 (100.00%) | |
172. NewsstandKit: 27 of 27 (100.00%) | |
173. Photos: 4 of 4 (100.00%) | |
174. PlaygroundBluetooth: 72 of 72 (100.00%) | |
175. PreferencePanes: 34 of 34 (100.00%) | |
176. ScreenSaver: 19 of 19 (100.00%) | |
177. SecurityFoundation: 9 of 9 (100.00%) | |
178. Social: 59 of 59 (100.00%) | |
179. TVUIKit: 75 of 75 (100.00%) | |
180. VisionKit: 11 of 11 (100.00%) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment