File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 99from .base_station import BaseStation
1010from .exceptions import IPNotFound
1111from .exceptions import DatabaseError
12+ from .asn import ASNInfo
Original file line number Diff line number Diff line change 55
66from .database import Reader
77from .district import DistrictInfo
8+ from .asn import ASNInfo
9+
810import json
911
1012class CityInfo :
@@ -29,7 +31,11 @@ class CityInfo:
2931 currency_name = ""
3032 anycast = ""
3133 line = ""
34+ usage_type = ""
3235 district_info = ""
36+ route = ""
37+ asn = ""
38+ asn_info = ""
3339
3440 def __init__ (self , ** kwargs ):
3541 self ._map = kwargs
@@ -45,6 +51,16 @@ def get_district(self):
4551 o ["city_name" ] = self .city_name
4652 return DistrictInfo (** o )
4753
54+ def get_asninfo (self ):
55+ if len (self .asn_info ) == 0 :
56+ return None
57+ ls = json .loads (self .asn_info )
58+ result = []
59+ for i in ls :
60+ result .append (ASNInfo (** i ))
61+
62+ return result
63+
4864
4965class City :
5066
Original file line number Diff line number Diff line change 44
55setup (
66 name = 'ipip-ipdb' ,
7- version = "1.5 .0" ,
7+ version = "1.6 .0" ,
88 description = (
99 'IPIP.net officially supported IP database ipdb format parsing library'
1010 ),
You can’t perform that action at this time.
0 commit comments