1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
Files
jc/docs/parsers/email_address.md

68 lines
1.4 KiB
Markdown
Raw Normal View History

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
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)