starcli icon indicating copy to clipboard operation
starcli copied to clipboard

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

Open hedyhli opened this issue 4 years ago • 19 comments

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.

hedyhli avatar Jun 28 '20 00:06 hedyhli

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

shivam212 avatar Jul 08 '20 06:07 shivam212

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

hedyhli avatar Jul 08 '20 06:07 hedyhli

Thanks for the help!

shivam212 avatar Jul 08 '20 09:07 shivam212

@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.

shivam212 avatar Jul 08 '20 13:07 shivam212

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 avatar Jul 08 '20 23:07 hedyhli

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

hedyhli avatar Jul 08 '20 23:07 hedyhli

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.

shivam212 avatar Jul 09 '20 03:07 shivam212

Take your time 😄

hedyhli avatar Jul 09 '20 04:07 hedyhli

@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.

shivam212 avatar Jul 14 '20 07:07 shivam212

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

hedyhli avatar Jul 14 '20 10:07 hedyhli

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

arcanearronax avatar Aug 18 '20 04:08 arcanearronax

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

hedyhli avatar Aug 19 '20 08:08 hedyhli

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?

arcanearronax avatar Sep 03 '20 02:09 arcanearronax

Sure @arcanearronax don't worry the delay

hedyhli avatar Sep 24 '20 08:09 hedyhli

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

26tanishabanik avatar Aug 26 '21 06:08 26tanishabanik

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?

fgsepter avatar Nov 16 '21 04:11 fgsepter

@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!

tongjin0521 avatar Nov 25 '21 05:11 tongjin0521

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

CristhianMotoche avatar Oct 11 '23 03:10 CristhianMotoche