Skip to content

Commit 2b438e8

Browse files
committed
Use IPs from range reserved for documentation
1 parent 5346e3c commit 2b438e8

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

README.rst

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Sync Web Service Example
7171
>>>
7272
>>> # Replace "insights" with the method corresponding to the web service
7373
>>> # that you are using, e.g., "country", "city".
74-
>>> response = client.insights('128.101.101.101')
74+
>>> response = client.insights('203.0.113.0')
7575
>>>
7676
>>> response.country.iso_code
7777
'US'
@@ -97,7 +97,7 @@ Sync Web Service Example
9797
-93.2323
9898
>>>
9999
>>> response.traits.network
100-
IPv4Network('128.101.101.101/32')
100+
IPv4Network('203.0.113.0/32')
101101
102102
Async Web Service Example
103103
------------------------
@@ -116,7 +116,7 @@ Async Web Service Example
116116
>>>
117117
>>> # Replace "insights" with the method corresponding to the web service
118118
>>> # that you are using, e.g., "country", "city".
119-
>>> response = await client.insights('128.101.101.101')
119+
>>> response = await client.insights('203.0.113.0')
120120
>>>
121121
>>> response.country.iso_code
122122
'US'
@@ -142,7 +142,7 @@ Async Web Service Example
142142
-93.2323
143143
>>>
144144
>>> response.traits.network
145-
IPv4Network('128.101.101.101/32')
145+
IPv4Network('203.0.113.0/32')
146146
147147
Web Service Client Exceptions
148148
-----------------------------
@@ -180,7 +180,7 @@ City Database
180180
>>>
181181
>>> # Replace "city" with the method corresponding to the database
182182
>>> # that you are using, e.g., "country".
183-
>>> response = reader.city('128.101.101.101')
183+
>>> response = reader.city('203.0.113.0')
184184
>>>
185185
>>> response.country.iso_code
186186
'US'
@@ -206,7 +206,7 @@ City Database
206206
-93.2323
207207
>>>
208208
>>> response.traits.network
209-
IPv4Network('128.101.101.0/24')
209+
IPv4Network('203.0.113.0/24')
210210
211211
Anonymous IP Database
212212
^^^^^^^^^^^^^^^^^^^^^
@@ -219,7 +219,7 @@ Anonymous IP Database
219219
>>> # across multiple requests as creation of it is expensive.
220220
>>> with geoip2.database.Reader('/path/to/GeoIP2-Anonymous-IP.mmdb') as reader:
221221
>>>
222-
>>> response = reader.anonymous_ip('85.25.43.84')
222+
>>> response = reader.anonymous_ip('203.0.113.0')
223223
>>>
224224
>>> response.is_anonymous
225225
True
@@ -232,9 +232,9 @@ Anonymous IP Database
232232
>>> response.is_tor_exit_node
233233
True
234234
>>> response.ip_address
235-
'85.25.43.84'
235+
'203.0.113.0'
236236
>>> response.network
237-
IPv4Network('85.25.43.0/24')
237+
IPv4Network('203.0.113.0/24')
238238
239239
ASN Database
240240
^^^^^^^^^^^^
@@ -246,11 +246,15 @@ ASN Database
246246
>>> # This creates a Reader object. You should use the same object
247247
>>> # across multiple requests as creation of it is expensive.
248248
>>> with geoip2.database.Reader('/path/to/GeoLite2-ASN.mmdb') as reader:
249-
>>> response = reader.asn('1.128.0.0')
249+
>>> response = reader.asn('203.0.113.0')
250250
>>> response.autonomous_system_number
251251
1221
252252
>>> response.autonomous_system_organization
253253
'Telstra Pty Ltd'
254+
>>> response.ip_address
255+
'203.0.113.0'
256+
>>> response.network
257+
IPv4Network('203.0.113.0/24')
254258
255259
Connection-Type Database
256260
^^^^^^^^^^^^^^^^^^^^^^^^
@@ -262,13 +266,13 @@ Connection-Type Database
262266
>>> # This creates a Reader object. You should use the same object
263267
>>> # across multiple requests as creation of it is expensive.
264268
>>> with geoip2.database.Reader('/path/to/GeoIP2-Connection-Type.mmdb') as reader:
265-
>>> response = reader.connection_type('128.101.101.101')
269+
>>> response = reader.connection_type('203.0.113.0')
266270
>>> response.connection_type
267271
'Corporate'
268272
>>> response.ip_address
269-
'128.101.101.101'
273+
'203.0.113.0'
270274
>>> response.network
271-
IPv4Network('128.101.101.101/24')
275+
IPv4Network('203.0.113.0/24')
272276
273277
274278
Domain Database
@@ -281,11 +285,11 @@ Domain Database
281285
>>> # This creates a Reader object. You should use the same object
282286
>>> # across multiple requests as creation of it is expensive.
283287
>>> with geoip2.database.Reader('/path/to/GeoIP2-Domain.mmdb') as reader:
284-
>>> response = reader.domain('128.101.101.101')
288+
>>> response = reader.domain('203.0.113.0')
285289
>>> response.domain
286290
'umn.edu'
287291
>>> response.ip_address
288-
'128.101.101.101'
292+
'203.0.113.0'
289293
290294
Enterprise Database
291295
^^^^^^^^^^^^^^^^^^^
@@ -299,7 +303,7 @@ Enterprise Database
299303
>>> with geoip2.database.Reader('/path/to/GeoIP2-Enterprise.mmdb') as reader:
300304
>>>
301305
>>> # Use the .enterprise method to do a lookup in the Enterprise database
302-
>>> response = reader.enterprise('128.101.101.101')
306+
>>> response = reader.enterprise('203.0.113.0')
303307
>>>
304308
>>> response.country.confidence
305309
99
@@ -333,7 +337,7 @@ Enterprise Database
333337
-93.2323
334338
>>>
335339
>>> response.traits.network
336-
IPv4Network('128.101.101.0/24')
340+
IPv4Network('203.0.113.0/24')
337341
338342
339343
ISP Database
@@ -346,7 +350,7 @@ ISP Database
346350
>>> # This creates a Reader object. You should use the same object
347351
>>> # across multiple requests as creation of it is expensive.
348352
>>> with geoip2.database.Reader('/path/to/GeoIP2-ISP.mmdb') as reader:
349-
>>> response = reader.isp('1.128.0.0')
353+
>>> response = reader.isp('203.0.113.0')
350354
>>> response.autonomous_system_number
351355
1221
352356
>>> response.autonomous_system_organization
@@ -356,9 +360,9 @@ ISP Database
356360
>>> response.organization
357361
'Telstra Internet'
358362
>>> response.ip_address
359-
'1.128.0.0'
363+
'203.0.113.0'
360364
>>> response.network
361-
IPv4Network('1.128.0.0/16')
365+
IPv4Network('203.0.113.0/24')
362366
363367
Database Reader Exceptions
364368
--------------------------

0 commit comments

Comments
 (0)