Skip to content

Commit

Permalink
Merge pull request #160 from slin63/iplookup_cleanup
Browse files Browse the repository at this point in the history
Document IP lookup feature / Fix iplookup None bug
Fix #141
  • Loading branch information
manparvesh committed Oct 3, 2018
2 parents d01fbf7 + 4318bbe commit 721b500
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -188,6 +188,15 @@ $ yoda ideas remove --task <task_name> --inside <project_name>
$ yoda ideas remove --project <project_name>
```

#### IP lookup

Get the geographical location of an IP address.

```
$ yoda iplookup 23.20.227.213
$ Virginia, United States
```

#### learn

This command group contains commands that, helpful in learning new things, will be. Yeesssssss.
Expand Down Expand Up @@ -282,6 +291,7 @@ To create an issue in the github repository simple thing that shows a link. Yee
- [urllib3](https://github.com/urllib3/urllib3): HTTP client
- [Certifi](https://github.com/certifi/python-certifi): Python SSL Certificates
- [idna](https://github.com/kjd/idna): For the domain name
- [GeoIP2-database](https://www.maxmind.com/en/geoip2-city): For geographical IP lookups
- [future](https://pypi.org/project/future/): the layer of compatability for Python 2/3
- [Google URL Shortener](https://developers.google.com/url-shortener/): URL shortener
- [News API](https://newsapi.org/): Used to get the top headlines from Hacker News
Expand Down
7 changes: 7 additions & 0 deletions modules/dev.py
Expand Up @@ -215,7 +215,14 @@ def taskMaster():
@click.pass_context
@click.argument('ip_address', nargs=1, required=False, callback=alias_checker)
def iplookup(ctx, ip_address):
"""
Find the geographical location of a given IP address.
"""
# import pdb; pdb.set_trace()
ip_address = get_arguments(ctx, 1)
if not ip_address:
return click.echo('Please supply an IP address as follows: $ yoda iplookup <ip_address>')

_ip_address = str(ip_address)

import geoip2.database
Expand Down

0 comments on commit 721b500

Please sign in to comment.