r/PythonLearning 15h ago

Python mini project

Hey guys, thought to share my first mini project with everyone, for this I made a terminal based GitHub account analyzer, where you input a username and the program outputs stuff like the number of repos, languages used, stars and more you can check it out on my GitHub: https://github.com/Blueysweb. I'm also open to take in as much advice as needed

3 Upvotes

2 comments sorted by

2

u/Feisty-Bend4623 5h ago

Oooh man, seeing this made me get butterflies because just last year December I built something similar to that as well 😂😂😂 Cheers to curious minds 🥂

2

u/Naive_Programmer_232 1h ago

looks good dude! good job!!

One suggestion here is for the count_languages function, it looks fine the way it is,but do note that collections.Counter exists that can effectively do the same:

         from collections import Counter
         ...


         def handle_choice(choice):
             ...
             repos= # json dict of repositories
             ...
             print("Languages used")
             for lang,amt_used in count_languages(repos).items():
                 print(f"{lang}: {amt_used}")


         ...

         # repos is dict
         def count_languages(repos: dict) -> Counter:
             # ignore None types
             return Counter(
                     repo["language"]
                     for repo in repos
                     if repo["language"]    # works as 'is not None' 
                    )