Skip to content

AethliosIK/securitytxt-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python security.txt parser

Install

Install from pip:

▶ pip install securitytxt-parser==1.0

Usage

Parse a security.txt variable:

from securitytxt import SecurityTxt

sectxt = "Contact: [email protected]\nAcknowledgements: https://yeswehack.com/programs/yes-we-hack"
s = SecurityTxt()
if s.parse(sectxt):
    print("Contact : %s" % s.contact())
    print(s.to_dict()) 

Parse a security.txt URL:

from securitytxt import SecurityTxt

s = SecurityTxt()
if s.parse_url("https://securitytxt.org/.well-known/security.txt"):
    print("Contact : %s" % s.contact())
    print(s.to_dict())

Set security.txt fields :

from securitytxt import SecurityTxt

sectxt = "Contact: [email protected]\nAcknowledgements: https://yeswehack.com/programs/yes-we-hack"
s = SecurityTxt(field_choices=['contact'])
if s.parse(sectxt):
    print(s.to_dict())

Releases

No releases published

Packages

No packages published

Languages