1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2026-06-19 22:28:17 +02:00

doc update

This commit is contained in:
Kelly Brazil
2022-07-19 13:02:09 -07:00
parent e56944dc24
commit 790103fb48
6 changed files with 171 additions and 3 deletions
+67
View File
@@ -0,0 +1,67 @@
[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)
+87
View File
@@ -0,0 +1,87 @@
[Home](https://kellyjonbrazil.github.io/jc/)
<a id="jc.parsers.url"></a>
# jc.parsers.url
jc - JSON Convert URL string parser
Usage (cli):
$ echo "http://example.com/test/path?q1=foo&q2=bar#frag" | jc --url
Usage (module):
import jc
result = jc.parse('url', url_string)
Schema:
{
"scheme": string,
"netloc": string,
"path": string or null,
"query": { object or null,
<query-key>: string
},
"fragment": string or null,
"username": string or null,
"password": string or null,
"hostname": string or null,
"port": integer or null
}
Examples:
$ echo "http://example.com/test/path?q1=foo&q2=bar#frag" | jc --url -p
{
"scheme": "http",
"netloc": "example.com",
"path": "/test/path",
"query": {
"q1": "foo",
"q2": "bar"
},
"fragment": "frag",
"username": null,
"password": null,
"hostname": "example.com",
"port": null
}
$ echo "ftp://localhost/filepath" | jc --url -p
{
"scheme": "ftp",
"netloc": "localhost",
"path": "/filepath",
"query": null,
"fragment": null,
"username": null,
"password": null,
"hostname": "localhost",
"port": null
}
<a id="jc.parsers.url.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)