Created
November 25, 2022 21:46
-
-
Save nicholasbishop/64d72cd3b37524c5906b4f6158c7ec1f to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python3 | |
# Usage: | |
# | |
# git clone https://github.com/rust-lang/crates.io-index.git | |
# cd crates.io-index | |
# Run features.py | |
import collections | |
import json | |
import os | |
def main(): | |
feature_counts = collections.Counter() | |
for (root, dirs, files) in os.walk('.'): | |
# Skip hidden | |
dirs[:] = [d for d in dirs if not d[0] == '.'] | |
for name in files: | |
if name == 'config.json': | |
continue | |
path = os.path.join(root, name) | |
with open(path, 'r') as rfile: | |
lines = rfile.read().splitlines() | |
last_version = json.loads(lines[-1]) | |
features = last_version['features'] | |
feature_counts.update(features.keys()) | |
for name, count in feature_counts.most_common(100): | |
print('{}: {}'.format(name, count)) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output as of Nov 25, 2022: