hedyhli / starcli

:sparkles: Browse trending GitHub projects from your command line
https://pypi.org/project/starcli/
MIT License
551 stars 50 forks source link

Add graph feature to show a star chart/graph of a repository #24

Open hedyhli opened 4 years ago

hedyhli commented 4 years ago

We can use probably a --graph option to display a graph of the star/fork/watcher or just the stars of one or more repositories, choosing a specific repository or display a graph for all repos fetched from search() is undecided. Play around and experiment with what you should do, if we are going to display a graph for every repo fetched, we should make the graph option one of the --layout choices.

Don't forget to update the help and usage both in __main__.py and also in the readme.

shivam212 commented 4 years ago

Hey, I would like to work on this, I am a newcomer to open source, any pointers on how to start on this?

hedyhli commented 4 years ago

You can setup your development environment using the tutorial in the contributing file, if it’s working properly you are good to go. This feature request is mainly about displaying a graph (or ASCII graph) in the terminal as described in the description above, you can try doing it locally on your computer, and push it and open a pull request. If you are stuck, feel free to ask 😃

Check this out for inspiration: https://starchart.cc/hedythedev/starcli Stargazers over time

shivam212 commented 4 years ago

Thanks for the help!

shivam212 commented 4 years ago

@hedythedev I may have to scrape and form the data for stars collected over a period of time myself, and doing that may take a longer time for repos with a very high number of stars, and can cause the program to slow down, should we look at only displaying graphs for repos with just enough stars so that the data scraping does not slow the whole thing down?

You can see the same problem here, https://starchart.cc/torvalds/linux, because this repo has a whole lot stars, the graph does not load.

hedyhli commented 4 years ago

Oh, I see. We could initially try getting all the star data, then after a timeout, it can display a message saying the star data is too much, and prompt the user to input a time range which to fetch the star info, if it's still after timeout, we can default it to probably one month. Is that better?

hedyhli commented 4 years ago

And if you know how to, we could also cache the data (maybe when starcli is running something else concurrently) so we don't have to scrape it again and again

shivam212 commented 4 years ago

Oh, I see. We could initially try getting all the star data, then after a timeout, it can display a message saying the star data is too much, and prompt the user to input a time range which to fetch the star info, if it's still after timeout, we can default it to probably one month. Is that better?

Yes, could be done.

And if you know how to, we could also cache the data (maybe when starcli is running something else concurrently) so we don't have to scrape it again and again

I'll have a go at this.

hedyhli commented 4 years ago

Take your time 😄

shivam212 commented 4 years ago

@hedythedev should we start off with making the graph listings as a new option? We can choose, say the 3 top repos, and show the graphs for them.

hedyhli commented 4 years ago

Sure, we could probably start by creating a function that takes in a string of the repo name (user/repo), fetch the stats, then if possible, display the graph. If the above is achieved, then we can do the command line option so that, maybe, the user can call it like starcli --graph ‘psf/black’ (Or some other repo), and a graph is displayed. We might deal with displaying a graph for the repos fetched from search() later

arcanearronax commented 4 years ago

If shivam212 isn't working on this anymore, I'd like to take this on.

hedyhli commented 4 years ago

No he isn’t, I will assign you @arcanearronax, thanks for your interest

arcanearronax commented 4 years ago

Sorry about the delay with this. I've been busy with work stuff and home life. I have put together what I would consider an MVP, but I do want to make some other changes to improve it. Would you want me to submit a pull request or start a new branch to make it available for further work?

hedyhli commented 4 years ago

Sure @arcanearronax don't worry the delay

26tanishabanik commented 3 years ago

@hedyhli I have the added a stargraph feature, https://github.com/hedyhli/starcli/pull/105

fgsepter commented 2 years ago

Hi! My friend and I come up with some ideas to better improve this graph feature, but have not decided which detailed features to add here. Can we work on this?

tongjin0521 commented 2 years ago

@hedyhli I have added two graph features enabling star or fork graph. Currently, we can choose to show the star/fork graph of a single repo or show the star/fork of multiple repos we got from the search() in one graph. The content is shown in the draft pull request. Please have a look at it and give some suggestions so that we can improve it :) Thx!

CristhianMotoche commented 12 months ago

Hello there! Was this issue solved? Is it still open for contribution?

giovannicanedoli commented 1 week ago

Hello! Can I help you with solving this issue?