Skip to content

Commit 64585aa

Browse files
fix lookup function when using _proxy object
1 parent 90990a6 commit 64585aa

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,20 @@ Replace `test` with your API Key in the following examples.
3535
You can look up the calling IP address, that is, the IP address of the computer you are running this on by not passing an IP address to the `lookup` method.
3636

3737
```
38-
from ipdata import ipdata
39-
from pprint import pprint
40-
# Create an instance of an ipdata object. Replace `test` with your API Key
41-
ipdata = ipdata.IPData('test')
42-
response = ipdata.lookup()
43-
pprint(response)
38+
>>> import ipdata
39+
>>> ipdata.api_key = <YOUR API KEY>
40+
>>> ipdata.lookup()
4441
```
4542

4643
### Looking up any IP Address
4744

4845
You can look up any valid IPv4 or IPv6 address by passing it to the `lookup` method.
4946

5047
```
51-
from ipdata import ipdata
52-
from pprint import pprint
53-
# Create an instance of an ipdata object. Replace `test` with your API Key
54-
ipdata = ipdata.IPData('test')
55-
response = ipdata.lookup('69.78.70.144')
48+
>>> from rich import pprint
49+
>>> import ipdata
50+
>>> ipdata.api_key = <YOUR API KEY>
51+
>>> response = ipdata.lookup('69.78.70.144')
5652
pprint(response)
5753
```
5854

src/ipdata/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
default_client = None
1515

1616

17-
def lookup(resource, fields=[]):
17+
def lookup(resource="", fields=[]):
1818
return _proxy("lookup", resource=resource, fields=fields)
1919

2020

0 commit comments

Comments
 (0)