-
-
Save wagenrace/d5fd3c25d4b5767457b09f9bdb20823d 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
import matplotlib.pyplot as plt | |
from matplotlib.pyplot import figure | |
from license_scanner import get_all_licenses | |
figure(figsize=(18, 16), dpi=80) | |
all_licenses = get_all_licenses() | |
l1 = [] | |
labels = [] | |
sizes = [] | |
for license_name, packages in all_licenses.items(): | |
l1.append([len(packages), license_name]) | |
l1.sort(key=lambda a: -a[0]) | |
total_num_packages = sum([i[0] for i in l1]) | |
for i in l1: | |
labels.append(i[1]) | |
sizes.append(i[0]) | |
print(f"{i[1]}: {100 * i[0]/total_num_packages:.2f}%") | |
plt.pie(sizes, labels=labels) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment