mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
68 lines
1.4 KiB
Markdown
68 lines
1.4 KiB
Markdown
![]() |
[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):
|
||
|
|
||
|
$ echo "johndoe@example.com" | jc --email-address
|
||
|
|
||
|
Usage (module):
|
||
|
|
||
|
import jc
|
||
|
result = jc.parse('email_address', email_address_string)
|
||
|
|
||
|
Schema:
|
||
|
|
||
|
{
|
||
|
"domain": string,
|
||
|
"local": string,
|
||
|
"local_plus_prefix": string or null,
|
||
|
"local_plus_suffix": string or null
|
||
|
}
|
||
|
|
||
|
Examples:
|
||
|
|
||
|
$ echo 'joe.user@gmail.com' | jc --email-address -p
|
||
|
{
|
||
|
"domain": "gmail.com",
|
||
|
"local": "joe.user",
|
||
|
"local_plus_prefix": null,
|
||
|
"local_plus_suffix": null
|
||
|
}
|
||
|
|
||
|
$ echo 'joe.user+spam@gmail.com' | jc --email-address -p
|
||
|
{
|
||
|
"domain": "gmail.com",
|
||
|
"local": "joe.user+spam",
|
||
|
"local_plus_prefix": "joe.user",
|
||
|
"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)
|