web2vec.extractors.url_geo_features module

class web2vec.extractors.url_geo_features.GeoLiteDbType(value)[source]

Bases: Enum

An enumeration.

ASN = 'GeoLite2-ASN'
COUNTRY = 'GeoLite2-Country'
class web2vec.extractors.url_geo_features.URLGeoFeatures(url: str, country_code: str, asn: int)[source]

Bases: object

asn: int
country_code: str
url: str
web2vec.extractors.url_geo_features.get_asn(ip_address: str) int | None[source]

Return the ASN associated with the given IP address.

web2vec.extractors.url_geo_features.get_country(ip_address: str) str | None[source]

Return the country code associated with the given IP address.

web2vec.extractors.url_geo_features.get_geolite_db_files(type: GeoLiteDbType | None = None) Dict[GeoLiteDbType, str] | str[source]

Download the latest GeoLite2-Country and GeoLite2-ASN database files from GitHub.

web2vec.extractors.url_geo_features.get_url_geo_features(url: str) URLGeoFeatures[source]

Return information about the given URL.

web2vec.extractors.url_geo_features.get_url_geo_features_cached(url: str) URLGeoFeatures[source]

Get the geo features for the given URL.