Analytics

class libs.Analytics(config: str)
_deep_analyze(url: str)

Analyze URL with PageView

Parameters:url – URL that latest get via requests
Returns:float of the-trust-score between 0 to 1
analyze(data: dict)

Do analysis from URL sent by message with databases

Parameters:data – dict from message decoded
Returns:dict to response
check_from_database(url: str, host: str = None)

Check URL whether existed in database

Parameters:
  • url – URL from request
  • url_hash – URL hashed
  • host – host from URL decoded
Returns:

trust_score or NoneType

gen_sample()

Generate PageView samples with trustlist

Returns:
start(port: int = 2020)

Start web service

Parameters:port – integer of port to listen online
Returns:
stop()

Shutdown web service

Returns:
update_blacklist_from_phishtank()

Update database for blacklist from PhishTank

Returns: