Closed mgutz closed 4 years ago
Yep, having a topic filter will be nice, thanks
I've just taken a look at the docs, seems like it should be quite easy to add this feature: https://docs.github.com/en/github/searching-for-information-on-github/searching-for-repositories#search-by-topic Not sure if including multiple topics would be possible
Hello, Could I work on this if nobody else is working?
Thanks.
No one is assigned, you can take this @ashikjm :)
As mentioned in the issue description we change have -t foo
and --topic foo
to filter by topic. if you can though, feel free to add the functionality to filter by multiple topics or even exclude a topic.
sure @hedythedev. Thanks. :)
@hedythedev I have raised a PR. I had implemented the exclude topics options too but removed it as the api doesn't work as expected for the topic qualifier.
Details: I tried to follow https://docs.github.com/en/github/searching-for-information-on-github/understanding-the-search-syntax#exclude-certain-results to exclude topics. However, this works for every other qualifier (eg: language, user) but not for topic. For eg: https://api.github.com/search/repositories?q=stars:%3E=100+created:2020-07-06+language:python+-topic:deep-learning and https://api.github.com/search/repositories?q=stars:%3E=100+created:2020-07-06+language:python+topic:deep-learning give the same output (note the - before the topic qualifier in first url).
We can open a new issue to implement the exclude topic option and work on it when this is fixed by github. Thoughts?
We can open a new issue to implement the exclude topic option and work on it when this is fixed by github. Thoughts?
@ashikjm that will be great, thanks
I don’t think a new option would be necessary though how about excluding them like -t ‘!cli’
or something?
That should work fine. Shall I update the README.md with this comment?
Can you elaborate on what you mean? Because I doubt !cli
itself would work
!topic
actually works. In the below example, there is only repo for creation date 2020-07-06 which has deep-cleaning
topic tagged. That gets filtered out when I use !deep-cleaning
`(venv) ➜ starcli -L list -l python -d 2020-07-06 ────────────────────────────────────────────────────────────────────────────────
google-research/torchsde 473 ⭐ 23 🍴 473 👀
Python
Differentiable SDE solvers with GPU support and efficient sensitivity analysis.
────────────────────────────────────────────────────────────────────────────────
(venv) ➜ starcli -L list -l python -d 2020-07-06 -t '!deep-learning'
(venv) ➜
(venv) ➜ `
I was trying to adding -
to the topic qualifier in the code, but looks like this should be good enough.
ok, I see. But the thing is, if I go to https://api.github.com/search/repositories?q=topic:!deep-learning&sort=stars&order=desc according to the logic, there should be lots of repos that doesn't have deep-learning topic, but the above link doesn't return any items 🤔
using the search in github.com doesn't work either: https://github.com/search?q=topic%3A%21deep-learning
oh yes. My bad. I was thinking it is filtering out the topic as there was only one repo and it didn't print. It is actually looking for the topic named "!deep-learning" which doesn't exist and hence no results.
Yeah, ok no worries. As to the -QUALIFIER
syntax I tried it on github.com/search and I think it actually works: https://github.com/search?q=cats+stars%3A>10+-topic%3Ajavascript&type=Repositories
but as you said doing this using the seach api doesn't work: https://api.github.com/search/repositories?q=stars:>=100+created:2020-07-06+language:python+-topic:deep-learning because google-research/torchsde does have deep learning topic
That said, I did find this to be working: https://api.github.com/search/repositories?q=cats+stars%3A>10+-topic%3Ajavascript
Yes, looks very tricky. Seems like -topic works when concatenated with a string search.
NO
More and more projects are tagged with relevant keywords (topic). Search by language is sometimes too broad. I would like to search within javascript language by topic react.
Command line flag
--topic -t Search by topic
that is used in combination with language flag.Not sure