Skip to content

Commit cd599c1

Browse files
authored
Merge pull request #151 from maxmind/horgh/sandbox
Document using the sandbox
2 parents 7769666 + 52707a5 commit cd599c1

File tree

8 files changed

+37
-25
lines changed

8 files changed

+37
-25
lines changed

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Apache License
33
Version 2.0, January 2004
4-
http://www.apache.org/licenses/
4+
https://www.apache.org/licenses/
55

66
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
77

@@ -193,7 +193,7 @@
193193
you may not use this file except in compliance with the License.
194194
You may obtain a copy of the License at
195195

196-
http://www.apache.org/licenses/LICENSE-2.0
196+
https://www.apache.org/licenses/LICENSE-2.0
197197

198198
Unless required by applicable law or agreed to in writing, software
199199
distributed under the License is distributed on an "AS IS" BASIS,

README.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Description
77

88
This package provides an API for the GeoIP2 and GeoLite2 `web services
99
<https://dev.maxmind.com/geoip/docs/web-services?lang=en>`_ and `databases
10-
<https://dev.maxmind.com/geoip/docs/databases?lang=en>`_.
10+
<https://dev.maxmind.com/geoip/docs/databases?lang=en>`_.
1111

1212
Installation
1313
------------
@@ -47,7 +47,9 @@ To use this API, you first construct either a ``geoip2.webservice.Client`` or
4747
``geoip2.webservice.AsyncClient``, passing your MaxMind ``account_id`` and
4848
``license_key`` to the constructor. To use the GeoLite2 web service instead of
4949
the GeoIP2 web service, set the optional ``host`` keyword argument to
50-
``geolite.info``.
50+
``geolite.info``. To use the Sandbox GeoIP2 web service instead of the
51+
production GeoIP2 web service, set the optional ``host`` keyword argument to
52+
``sandbox.maxmind.com``.
5153

5254
After doing this, you may call the method corresponding to request type
5355
(e.g., ``city`` or ``country``), passing it the IP address you want to look up.
@@ -68,7 +70,9 @@ Sync Web Service Example
6870
>>> # This creates a Client object that can be reused across requests.
6971
>>> # Replace "42" with your account ID and "license_key" with your license
7072
>>> # key. Set the "host" keyword argument to "geolite.info" to use the
71-
>>> # GeoLite2 web service instead of the GeoIP2 web service.
73+
>>> # GeoLite2 web service instead of the GeoIP2 web service. Set the
74+
>>> # "host" keyword argument to "sandbox.maxmind.com" to use the Sandbox
75+
>>> # GeoIP2 web service instead of the production GeoIP2 web service.
7276
>>> with geoip2.webservice.Client(42, 'license_key') as client:
7377
>>>
7478
>>> # Replace "city" with the method corresponding to the web service
@@ -118,7 +122,9 @@ Async Web Service Example
118122
>>> #
119123
>>> # Replace "42" with your account ID and "license_key" with your license
120124
>>> # key. Set the "host" keyword argument to "geolite.info" to use the
121-
>>> # GeoLite2 web service instead of the GeoIP2 web service.
125+
>>> # GeoLite2 web service instead of the GeoIP2 web service. Set the
126+
>>> # "host" keyword argument to "sandbox.maxmind.com" to use the Sandbox
127+
>>> # GeoIP2 web service instead of the production GeoIP2 web service.
122128
>>> async with geoip2.webservice.AsyncClient(42, 'license_key') as client:
123129
>>>
124130
>>> # Replace "city" with the method corresponding to the web service
@@ -456,7 +462,7 @@ attribute in the ``geoip2.records.Traits`` record.
456462
Integration with GeoNames
457463
-------------------------
458464

459-
`GeoNames <http://www.geonames.org/>`_ offers web services and downloadable
465+
`GeoNames <https://www.geonames.org/>`_ offers web services and downloadable
460466
databases with data on geographical features around the world, including
461467
populated places. They offer both free and paid premium data. Each feature is
462468
uniquely identified by a ``geoname_id``, which is an integer.
@@ -473,31 +479,31 @@ Reporting Data Problems
473479
-----------------------
474480

475481
If the problem you find is that an IP address is incorrectly mapped, please
476-
`submit your correction to MaxMind <http://www.maxmind.com/en/correction>`_.
482+
`submit your correction to MaxMind <https://www.maxmind.com/en/correction>`_.
477483

478484
If you find some other sort of mistake, like an incorrect spelling, please
479-
check the `GeoNames site <http://www.geonames.org/>`_ first. Once you've
485+
check the `GeoNames site <https://www.geonames.org/>`_ first. Once you've
480486
searched for a place and found it on the GeoNames map view, there are a
481487
number of links you can use to correct data ("move", "edit", "alternate
482488
names", etc.). Once the correction is part of the GeoNames data set, it
483489
will be automatically incorporated into future MaxMind releases.
484490

485491
If you are a paying MaxMind customer and you're not sure where to submit a
486492
correction, please `contact MaxMind support
487-
<http://www.maxmind.com/en/support>`_ for help.
493+
<https://www.maxmind.com/en/support>`_ for help.
488494

489495
Requirements
490496
------------
491497

492498
Python 3.7 or greater is required. Older versions are not supported.
493499

494500
The Requests HTTP library is also required. See
495-
<http://python-requests.org> for details.
501+
<https://pypi.org/project/requests/> for details.
496502

497503
Versioning
498504
----------
499505

500-
The GeoIP2 Python API uses `Semantic Versioning <http://semver.org/>`_.
506+
The GeoIP2 Python API uses `Semantic Versioning <https://semver.org/>`_.
501507

502508
Support
503509
-------
@@ -507,4 +513,4 @@ Please report all issues with this code using the `GitHub issue tracker
507513

508514
If you are having an issue with a MaxMind service that is not specific to the
509515
client API, please contact `MaxMind support
510-
<http://www.maxmind.com/en/support>`_ for assistance.
516+
<https://www.maxmind.com/en/support>`_ for assistance.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
# General information about the project.
5151
project = "geoip2"
52-
copyright = "2013-2022, MaxMind, Inc."
52+
copyright = "2013-2023, MaxMind, Inc."
5353

5454
# The version info for the project you're documenting, acts as replacement for
5555
# |version| and |release|, also used in various other places throughout the

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ Indices and tables
3838
* :ref:`modindex`
3939
* :ref:`search`
4040

41-
:copyright: (c) 2013-2022 by MaxMind, Inc.
41+
:copyright: (c) 2013-2023 by MaxMind, Inc.
4242
:license: Apache License, Version 2.0
4343

geoip2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
__version__ = "4.7.0"
55
__author__ = "Gregory Oschwald"
66
__license__ = "Apache License, Version 2.0"
7-
__copyright__ = "Copyright (c) 2013-2022 Maxmind, Inc."
7+
__copyright__ = "Copyright (c) 2013-2023 MaxMind, Inc."

geoip2/records.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class Country(PlaceRecord):
188188
.. attribute:: iso_code
189189
190190
The two-character `ISO 3166-1
191-
<http://en.wikipedia.org/wiki/ISO_3166-1>`_ alpha code for the
191+
<https://en.wikipedia.org/wiki/ISO_3166-1>`_ alpha code for the
192192
country.
193193
194194
:type: str
@@ -264,7 +264,7 @@ class RepresentedCountry(Country):
264264
.. attribute:: iso_code
265265
266266
The two-character `ISO 3166-1
267-
<http://en.wikipedia.org/wiki/ISO_3166-1>`_ alpha code for the country.
267+
<https://en.wikipedia.org/wiki/ISO_3166-1>`_ alpha code for the country.
268268
269269
:type: str
270270
@@ -373,7 +373,7 @@ class Location(Record):
373373
.. attribute:: time_zone
374374
375375
The time zone associated with location, as specified by the `IANA Time
376-
Zone Database <http://www.iana.org/time-zones>`_, e.g.,
376+
Zone Database <https://www.iana.org/time-zones>`_, e.g.,
377377
"America/New_York".
378378
379379
:type: str
@@ -492,7 +492,7 @@ class Subdivision(PlaceRecord):
492492
493493
This is a string up to three characters long
494494
contain the subdivision portion of the `ISO 3166-2 code
495-
<http://en.wikipedia.org/wiki/ISO_3166-2>`_.
495+
<https://en.wikipedia.org/wiki/ISO_3166-2>`_.
496496
497497
:type: str
498498
@@ -582,7 +582,7 @@ class Traits(Record):
582582
.. attribute:: autonomous_system_number
583583
584584
The `autonomous system
585-
number <http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>`_
585+
number <https://en.wikipedia.org/wiki/Autonomous_system_(Internet)>`_
586586
associated with the IP address. This attribute is only available from
587587
the City Plus and Insights web services and the Enterprise database.
588588
@@ -591,7 +591,7 @@ class Traits(Record):
591591
.. attribute:: autonomous_system_organization
592592
593593
The organization associated with the registered `autonomous system
594-
number <http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>`_ for
594+
number <https://en.wikipedia.org/wiki/Autonomous_system_(Internet)>`_ for
595595
the IP address. This attribute is only available from the City Plus and
596596
Insights web service end points and the Enterprise database.
597597

geoip2/webservice.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ class AsyncClient(BaseClient):
220220
221221
:param host: The hostname to make a request against. This defaults to
222222
"geoip.maxmind.com". To use the GeoLite2 web service instead of the
223-
GeoIP2 web service, set this to "geolite.info".
223+
GeoIP2 web service, set this to "geolite.info". To use the Sandbox
224+
GeoIP2 web service instead of the production GeoIP2 web service, set
225+
this to "sandbox.maxmind.com". The sandbox allows you to experiment
226+
with the API without affecting your production data.
224227
:param locales: This is list of locale codes. This argument will be
225228
passed on to record classes to use when their name properties are
226229
called. The default value is ['en'].
@@ -379,7 +382,10 @@ class Client(BaseClient):
379382
380383
:param host: The hostname to make a request against. This defaults to
381384
"geoip.maxmind.com". To use the GeoLite2 web service instead of the
382-
GeoIP2 web service, set this to "geolite.info".
385+
GeoIP2 web service, set this to "geolite.info". To use the Sandbox
386+
GeoIP2 web service instead of the production GeoIP2 web service, set
387+
this to "sandbox.maxmind.com". The sandbox allows you to experiment
388+
with the API without affecting your production data.
383389
:param locales: This is list of locale codes. This argument will be
384390
passed on to record classes to use when their name properties are
385391
called. The default value is ['en'].

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author = Gregory Oschwald
44
author_email = [email protected]
55
license = Apache License, Version 2.0
66
description = MaxMind GeoIP2 API
7-
url = http://www.maxmind.com/
7+
url = https://www.maxmind.com/
88
long_description = file: README.rst
99
classifiers =
1010
Development Status :: 5 - Production/Stable

0 commit comments

Comments
 (0)