Add graph feature to show a star chart/graph of a repository
hedyhli opened this issue · 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.
Hey, I would like to work on this, I am a newcomer to open source, any pointers on how to start on this?
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
Thanks for the help!
@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.
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?
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
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.
Take your time 😄
@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.
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
If shivam212 isn't working on this anymore, I'd like to take this on.
No he isn’t, I will assign you @arcanearronax, thanks for your interest
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?
Sure @arcanearronax don't worry the delay
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?
@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!
Hello there! Was this issue solved? Is it still open for contribution?