Skip to content

Commit cd33976

Browse files
committed
Merge branch 'master' of github.com:ipinfo/python
2 parents 24e9fc5 + d4e257f commit cd33976

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
IPInfo-Python: A Python wrapper for the `IPInfo <https://ipinfo.io/>`_ API.
1+
The official Python library for the `IPInfo <https://ipinfo.io/>`_ API.
22
###########################################################################
33

4-
IPInfo-Python is a lightweight wrapper for the IPInfo API, which provides up-to-date IP address data.
4+
`ipinfo_wrapper` is a lightweight wrapper for the IPInfo API, which provides up-to-date IP address data.
55

66
.. contents::
77

@@ -10,11 +10,11 @@ IPInfo-Python is a lightweight wrapper for the IPInfo API, which provides up-to-
1010
Usage
1111
=====
1212

13-
The `IPInfo.getDetails()` method accepts an IP address as an optional, positional argument. If no IP address is specified, the API will return data for the IP address from which it receives the request.
13+
The `Handler.getDetails()` method accepts an IP address as an optional, positional argument. If no IP address is specified, the API will return data for the IP address from which it receives the request.
1414

15-
>>> import ipinfo
15+
>>> import ipinfo_wrapper
1616
>>> access_token = '123456789abc'
17-
>>> handler = ipinfo.getHandler(access_token)
17+
>>> handler = ipinfo_wrapper.getHandler(access_token)
1818
>>> ip_address = '216.239.36.21'
1919
>>> details = handler.getDetails(ip_address)
2020
>>> details.city
@@ -27,7 +27,7 @@ Authentication
2727
The IPInfo library can be authenticated with your IPInfo API token, which is passed in as a positional argument. It also works without an authentication token, but in a more limited capacity.
2828

2929
>>> access_token = '123456789abc'
30-
>>> handler = ipinfo(access_token)
30+
>>> handler = ipinfo_wrapper.getHandler(access_token)
3131

3232

3333
Details Data
@@ -115,14 +115,14 @@ Cache behavior can be modified by setting the `cache_options` keyword argument.
115115
* Default maximum cache size: 4096 (multiples of 2 are recommended to increase efficiency)
116116
* Default TTL: 24 hours (in seconds)
117117

118-
>>> handler = ipinfo(cache_options={'ttl':30, 'maxsize': 128})
118+
>>> handler = ipinfo_wrapper.getHandler(cache_options={'ttl':30, 'maxsize': 128})
119119

120120
Using a different cache
121121
-----------------------
122122

123123
It's possible to use a custom cache by creating a child class of the `CacheInterface <https://github.com/jhtimmins/ipinfo-python/blob/master/cache/interface.py>`_ class and passing this into the handler object with the `cache` keyword argument. FYI this is known as `the Strategy Pattern <https://sourcemaking.com/design_patterns/strategy>`_.
124124

125-
>>> handler = ipinfo(cache=my_fancy_custom_class)
125+
>>> handler = ipinfo_wrapper.getHandler(cache=my_fancy_custom_class)
126126

127127

128128
Internationalization

0 commit comments

Comments
 (0)