API reference

exception pysecuritytxt.PySecurityTXTException
exception pysecuritytxt.SecurityTXTNotAvailable

PySecurityTXT

class pysecuritytxt.PySecurityTXT(loglevel: int = 20, useragent: str | None = None, *, proxies: dict[str, str] | None = None)
get(hint: str, /, *, parse: bool = False) str

Get the security.txt file.

Parameters:
  • hint – It can be a domain, an IP or an URL (and we try to figure out where the file is), or a full URL to the file.

  • parse – Parse the file and returns a json dictionary with the relevant fields

parse(file: str) dict[str, str | list[str]]

Takes a security.txt file, parses it.

Parameters:

file – The security.txt file.