Search Github from the command line, the quick and dirty way
Project description
## githsearch
For quick checking from the command line
## Installation
`pip install githsearch`
## Usage
You can search for repos or users.
First instantiate the main class,
and to search for a repo call `get_repo` and pass the terms you want to search as arguments :
```python
>>> from githsearch import GithSearch
>>> g=GithSearch()
>>> g.get_repo('python tetris clone pygame')
--> https://github.com/davidcollins4481/tetris-clone
-- Tetris Clone in Python (PyGame)
--> https://github.com/zxmarcos/pytrix
-- Tetris clone in Python + PyGame
--> https://github.com/nickcrafford/python-pygame-tetris
-- Quick and dirty Tetris clone written to learn Pygame.
--> https://github.com/davepgreene/tetris-clone
-- A Tetris clone written in Python with pygame
...
```
The search outputs the 30 most relevant results.
To search for a user is the same but call `get_user` instead
```python
>>> g.get_user('test')
--> test
-- https://github.com/test
--> prinnotamago
-- https://github.com/prinnotamago
--> diannt
-- https://github.com/diannt
--> 73153
-- https://github.com/73153
--> ssweetin
-- https://github.com/ssweetin
--> deekoder
-- https://github.com/deekoder
...
```
But be aware that githsearch uses the free quotas from github search API so there is a rate limit. You can consult it by calling :
```python
>>> g.get_limit
{'remaining': 10, 'reset': 1453497872, 'limit': 10}
```
As long as you don't hammer down the API you should be okay.
Another thing : by default the results are just **displayed** on the terminal.
You can have the results in a variable by calling the functions with the flag `printed` set to `False` like so :
```python
>>> result=g.get_repo('python tetris', printed=False)
>>> len(result)
30
>>>
```
(Bonus : lines alternate in a purple color which is cute)
For quick checking from the command line
## Installation
`pip install githsearch`
## Usage
You can search for repos or users.
First instantiate the main class,
and to search for a repo call `get_repo` and pass the terms you want to search as arguments :
```python
>>> from githsearch import GithSearch
>>> g=GithSearch()
>>> g.get_repo('python tetris clone pygame')
--> https://github.com/davidcollins4481/tetris-clone
-- Tetris Clone in Python (PyGame)
--> https://github.com/zxmarcos/pytrix
-- Tetris clone in Python + PyGame
--> https://github.com/nickcrafford/python-pygame-tetris
-- Quick and dirty Tetris clone written to learn Pygame.
--> https://github.com/davepgreene/tetris-clone
-- A Tetris clone written in Python with pygame
...
```
The search outputs the 30 most relevant results.
To search for a user is the same but call `get_user` instead
```python
>>> g.get_user('test')
--> test
-- https://github.com/test
--> prinnotamago
-- https://github.com/prinnotamago
--> diannt
-- https://github.com/diannt
--> 73153
-- https://github.com/73153
--> ssweetin
-- https://github.com/ssweetin
--> deekoder
-- https://github.com/deekoder
...
```
But be aware that githsearch uses the free quotas from github search API so there is a rate limit. You can consult it by calling :
```python
>>> g.get_limit
{'remaining': 10, 'reset': 1453497872, 'limit': 10}
```
As long as you don't hammer down the API you should be okay.
Another thing : by default the results are just **displayed** on the terminal.
You can have the results in a variable by calling the functions with the flag `printed` set to `False` like so :
```python
>>> result=g.get_repo('python tetris', printed=False)
>>> len(result)
30
>>>
```
(Bonus : lines alternate in a purple color which is cute)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
githsearch-0.1.0.tar.gz
(3.9 kB
view hashes)
Built Distributions
githsearch-0.1.0-py3.4.egg
(5.0 kB
view hashes)
Close
Hashes for githsearch-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4373d1acfd1288f31dab6903a3162545849c04e10fa07870fbbdb229189581c2 |
|
MD5 | 7c9b8fc7006e8fbaaac18df349e4b674 |
|
BLAKE2b-256 | 6020b88861e53b27356f9a94be6291c7ad2126e5253cf0c2b3c20a5502b8a2a5 |