
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Pyrolysate is a Python library and CLI tool for parsing and validating URLs and email addresses. It breaks down URLs and emails into their component parts, validates against IANA's official TLD list, and outputs structured data in JSON, CSV, or text format.
The library offers both a programmer-friendly API and a command-line interface, making it suitable for both development integration and quick data processing tasks. It handles single entries or large datasets efficiently using Python's generator functionality, and provides flexible input/output options including file processing with custom delimiters.
pip install pyrolysate
git clone https://github.com/dawnandrew100/pyrolysate.git
cd pyrolysate
# Using hatch (recommended)
hatch env create
# Or using venv
python -m venv .venv
# Windows
.venv\Scripts\activate
# Unix/MacOS
source .venv/bin/activate
# Using hatch
hatch run dev
# Or using pip
pip install -e .
# Using hatch (recommended)
hatch run pyro -u example.com
# Or using the CLI directly
pyro -u example.com
The CLI command pyro
will be available after installation. If the command isn't found, ensure Python's Scripts directory is in your PATH.
from pyrolysate import parse_input_file
urls = parse_input_file("urls.txt")
emails = parse_input_file("emails.csv", delimiter=",")
from pyrolysate import email
result = email.parse_email("user@example.com")
emails = ["user1@example.com", "user2@agency.gov.uk"]
result = email.parse_email_array(emails)
json_output = email.to_json("user@example.com")
json_output = email.to_json(["user1@example.com", "user2@example.com"])
email.to_json_file("output", "user@example.com")
email.to_json_file("output", ["user1@example.com", "user2@test.org"])
csv_output = email.to_csv("user@example.com")
csv_output = email.to_csv(["user1@example.com", "user2@test.org"])
email.to_csv_file("output", "user@example.com")
email.to_csv_file("output", ["user1@example.com", "user2@test.org"])
from pyrolysate import url
result = url.parse_url("https://www.example.com/path?q=test#fragment")
urls = ["example.com", "https://www.test.org"]
result = url.parse_url_array(urls)
json_output = url.to_json("example.com")
json_output = url.to_json(["example.com", "test.org"])
url.to_json_file("output", "example.com")
url.to_json_file("output", ["example.com", "test.org"])
csv_output = url.to_csv("example.com")
csv_output = url.to_csv(["example.com", "test.org"])
url.to_csv_file("output", "example.com")
url.to_csv_file("output", ["example.com", "test.org"])
pyro -h
pyro -u example.com
pyro -u example1.com example2.com
pyro -u -i urls.txt
pyro -u -i urls.csv -d ","
pyro -e user1@example.com user2@example.com -j -o output
pyro -u -i urls.txt -c -o parsed_urls
pyro -e -i emails.txt -d "," -o output
pyro -e user@example.com -j -np
Method | Parameters | Description |
---|---|---|
parse_email(email_str) | email_str: str | Parses single email address |
parse_email_array(emails) | emails: list[str] | Parses list of email addresses |
to_json(emails, prettify=True) | emails: str|list[str] , prettify: bool | Converts to JSON format |
to_json_file(file_name, emails, prettify=True) | file_name: str , emails: list[str] , prettify: bool | Converts and saves JSON to file |
to_csv(emails) | emails: str|list[str] | Converts to CSV format |
to_csv_file(file_name, emails) | file_name: str , emails: list[str] | Converts and saves CSV to file |
Method | Parameters | Description |
---|---|---|
parse_url(url_str, tlds=[]) | url_str: str , tlds: list[str] | Parses single URL |
parse_url_array(urls, tlds=[]) | urls: list[str] , tlds: list[str] | Parses list of URLs |
to_json(urls, prettify=True) | urls: str|list[str] , prettify: bool | Converts to JSON format |
to_json_file(file_name, urls, prettify=True) | file_name: str , urls: list[str] , prettify: bool | Converts and saves JSON to file |
to_csv(urls) | urls: str|list[str] | Converts to CSV format |
to_csv_file(file_name, urls) | file_name: str , urls: list[str] | Converts and saves CSV to file |
get_tld(path_to_tlds_file='tld.txt') | path_to_tlds_file: str = 'tld.txt' | Fetches current TLD list from IANA |
local_tld_file(file_name) | file_name: str | Fetches and stores get_tld() output as a local txt file |
Method | Parameters | Description |
---|---|---|
parse_input_file(input_file_name, delimiter='\n') | input_file_name: str , delimiter: str | Parses input file into python list by delimiter |
Argument | Type | Value when argument is omitted | Description |
---|---|---|---|
target | str | None | Email or URL string(s) to process |
-u , --url | flag | False | Specify URL input |
-e , --email | flag | False | Specify Email input |
-i , --input_file | str | None | Input file name with extension |
-o , --output_file | str | None | Output file name without extension |
-c , --csv | flag | False | Save output as CSV format |
-j , --json | flag | False | Save output as JSON format |
-np , --no_prettify | flag | True | Turn off prettified JSON output |
-d , --delimiter | str | '\n' | Delimiter for input file parsing |
Field | Description | Example |
---|---|---|
username | Part before @ | user |
mail_server | Domain before TLD | gmail |
domain | Top-level domain | com |
Example output:
{"user@gmail.com":
{
"username": "user",
"mail_server": "gmail",
"domain": "com"
}
}
email,username,mail_server,domain
user@gmail.com,user,gmail,com
Field | Description | Example |
---|---|---|
scheme | Protocol | https |
subdomain | Domain prefix | www |
second_level_domain | Main domain | example |
top_level_domain | Domain suffix | com |
port | Port number | 443 |
path | URL path | blog/post |
query | Query parameters | q=test |
fragment | URL fragment | section1 |
Example output:
{"https://www.example.com:443/blog/post?q=test#section1":
{
"scheme": "https",
"subdomain": "www",
"second_level_domain": "example",
"top_level_domain": "com",
"port": "443",
"path": "blog/post",
"query": "q=test",
"fragment": "section1"
}
}
url,scheme,subdomain,second_level_domain,top_level_domain,port,path,query,fragment
https://www.example.com:443/blog/post?q=test#section1,https,www,example,com,443,blog/post,q=test,section1
example@mail.com
example@agency.gov.uk
example.com
www.example.com
https://example.com
example.com/path/to/file.txt
example.com:8080
example.com/search?q=test
example.com#section1
192.168.1.1:8080
agency.gov.uk
https://www.example.gov.uk:8080/path?q=test#section1
FAQs
Parser made to convert lists of emails and urls into JSON and CSV formatted files
We found that pyrolysate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.