Skip to content

Commit 216f79c

Browse files
committed
Move headings to Sphinx template
This improves the layout of the docs and makes the class documentation more usable in Python. Also includes some minor wording changes.
1 parent af6de31 commit 216f79c

File tree

7 files changed

+28
-37
lines changed

7 files changed

+28
-37
lines changed

docs/index.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,51 @@
88

99
.. include:: ../README.rst
1010

11-
=======
12-
Modules
13-
=======
14-
1511
.. automodule:: geoip2
1612
:members:
1713
:inherited-members:
1814
:show-inheritance:
1915

16+
===============
17+
Database Reader
18+
===============
19+
2020
.. automodule:: geoip2.database
2121
:members:
2222
:inherited-members:
2323
:show-inheritance:
2424

25+
==================
26+
WebServices Client
27+
==================
28+
2529
.. automodule:: geoip2.webservice
2630
:members:
2731
:inherited-members:
2832
:show-inheritance:
2933

34+
======
35+
Models
36+
======
37+
3038
.. automodule:: geoip2.models
3139
:members:
3240
:inherited-members:
3341
:show-inheritance:
3442

43+
=======
44+
Records
45+
=======
46+
3547
.. automodule:: geoip2.records
3648
:members:
3749
:inherited-members:
3850
:show-inheritance:
3951

52+
======
53+
Errors
54+
======
55+
4056
.. automodule:: geoip2.errors
4157
:members:
4258
:inherited-members:

geoip2/_internal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""This package contains internal utilities."""
1+
"""Internal utilities."""
22

33
# pylint: disable=too-few-public-methods
44
from abc import ABCMeta
@@ -15,7 +15,7 @@ def __ne__(self, other) -> bool:
1515

1616
# pylint: disable=too-many-branches
1717
def to_dict(self) -> dict:
18-
"""Returns a dict of the object suitable for serialization."""
18+
"""Return a dict of the object suitable for serialization."""
1919
result = {}
2020
for key, value in self.__dict__.items():
2121
if key.startswith("_"):

geoip2/database.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
"""
2-
======================
3-
GeoIP2 Database Reader
4-
======================
5-
6-
"""
1+
"""The database reader for MaxMind MMDB files."""
72

83
import inspect
94
import os

geoip2/errors.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
"""
2-
Errors
3-
======
4-
5-
"""
1+
"""Typed errors thrown by this library."""
62

73
import ipaddress
8-
94
from typing import Optional, Union
105

116

geoip2/models.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
"""
2-
Models
3-
======
4-
5-
These classes provide models for the data returned by the GeoIP2
6-
web service and databases.
1+
"""The models for response from th GeoIP2 web service and databases.
72
83
The only difference between the City and Insights model classes is which
94
fields in each record may be populated. See
105
https://dev.maxmind.com/geoip/docs/web-services?lang=en for more details.
11-
126
"""
137

148
# pylint: disable=too-many-instance-attributes,too-few-public-methods,too-many-arguments

geoip2/records.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
"""
2-
3-
Records
4-
=======
5-
6-
"""
1+
"""Record classes used within the response models."""
72

83
# pylint:disable=too-many-arguments,too-many-positional-arguments,too-many-instance-attributes,too-many-locals
94

geoip2/webservice.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
"""
2-
============================
3-
WebServices Client API
4-
============================
1+
"""Client for GeoIP2 and GeoLite2 web services.
52
6-
This class provides a client API for all the GeoIP2 web services. The web
7-
services are Country, City Plus, and Insights. Each service returns a
3+
The web services are Country, City Plus, and Insights. Each service returns a
84
different set of data about an IP address, with Country returning the least
95
data and Insights the most.
106

0 commit comments

Comments
 (0)