2022-07-19 13:02:09 -07:00
|
|
|
[Home](https://kellyjonbrazil.github.io/jc/)
|
|
|
|
<a id="jc.parsers.email_address"></a>
|
|
|
|
|
|
|
|
# jc.parsers.email\_address
|
|
|
|
|
|
|
|
jc - JSON Convert Email Address string parser
|
|
|
|
|
|
|
|
Usage (cli):
|
|
|
|
|
2022-07-23 10:45:11 -07:00
|
|
|
$ echo "username@example.com" | jc --email-address
|
2022-07-19 13:02:09 -07:00
|
|
|
|
|
|
|
Usage (module):
|
|
|
|
|
|
|
|
import jc
|
|
|
|
result = jc.parse('email_address', email_address_string)
|
|
|
|
|
|
|
|
Schema:
|
|
|
|
|
|
|
|
{
|
2022-07-23 10:45:11 -07:00
|
|
|
"username": string,
|
2022-07-19 13:02:09 -07:00
|
|
|
"domain": string,
|
|
|
|
"local": string,
|
|
|
|
"local_plus_suffix": string or null
|
|
|
|
}
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ echo 'joe.user@gmail.com' | jc --email-address -p
|
|
|
|
{
|
2022-07-23 10:45:11 -07:00
|
|
|
"username": "joe.user",
|
2022-07-19 13:02:09 -07:00
|
|
|
"domain": "gmail.com",
|
|
|
|
"local": "joe.user",
|
|
|
|
"local_plus_suffix": null
|
|
|
|
}
|
|
|
|
|
|
|
|
$ echo 'joe.user+spam@gmail.com' | jc --email-address -p
|
|
|
|
{
|
2022-07-23 10:45:11 -07:00
|
|
|
"username": "joe.user",
|
2022-07-19 13:02:09 -07:00
|
|
|
"domain": "gmail.com",
|
|
|
|
"local": "joe.user+spam",
|
|
|
|
"local_plus_suffix": "spam"
|
|
|
|
}
|
|
|
|
|
|
|
|
<a id="jc.parsers.email_address.parse"></a>
|
|
|
|
|
|
|
|
### parse
|
|
|
|
|
|
|
|
```python
|
|
|
|
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
|
|
|
```
|
|
|
|
|
|
|
|
Main text parsing function
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
data: (string) text data to parse
|
|
|
|
raw: (boolean) unprocessed output if True
|
|
|
|
quiet: (boolean) suppress warning messages if True
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
|
|
|
|
Dictionary. Raw or processed structured data.
|
|
|
|
|
|
|
|
### Parser Information
|
|
|
|
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
|
|
|
|
2023-12-21 14:55:21 -08:00
|
|
|
Source: [`jc/parsers/email_address.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/email_address.py)
|
|
|
|
|
2024-01-03 15:57:08 -08:00
|
|
|
This parser can be used with the `--slurp` command-line option.
|
|
|
|
|
|
|
|
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|