Skip to content

Commit dc74b6c

Browse files
authored
Merge pull request #4 from UmanShahzad/uman/docstrings
Add docstrings everywhere it may be useful.
2 parents e4a2cbf + 20d0744 commit dc74b6c

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

ipinfo/cache/default.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""
2+
A default cache implementation that uses `cachetools` for an in-memory LRU cache.
3+
"""
4+
15
import cachetools
26
from .interface import CacheInterface
37

ipinfo/cache/interface.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""
2+
Abstract interface for caching IPinfo data.
3+
"""
4+
15
import abc
26

37

ipinfo/details.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""
2+
Details returned by the IPinfo service.
3+
"""
4+
15
class Details:
26
"""Encapsulates data for single IP address."""
37

ipinfo/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""
2+
Exceptions thrown by the IPinfo service.
3+
"""
4+
15
class RequestQuotaExceededError(Exception):
26
"""Error indicating that users monthly request quota has been passed."""
37
pass

ipinfo/handler.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
"""
2+
Main API client handler for fetching data from the IPinfo service.
3+
"""
4+
15
import ipaddress
26
import json
3-
import operator
47
import os
58
import requests
69
import sys
@@ -9,7 +12,7 @@
912
from .exceptions import RequestQuotaExceededError
1013

1114

12-
class Handler():
15+
class Handler:
1316
"""
1417
Allows client to request data for specified IP address. Instantiates and
1518
and maintains access to cache.

0 commit comments

Comments
 (0)