1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-10-08 23:22:21 +02:00

update docs

This commit is contained in:
Kelly Brazil
2020-07-30 16:20:24 -07:00
parent dda517a937
commit 82b9c87a66
58 changed files with 345 additions and 62 deletions

View File

@@ -1,3 +1,4 @@
# jc.parsers.airport
jc - JSON CLI output utility airport -I Parser
@@ -52,11 +53,13 @@ Examples:
"channel": "48,80"
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -90,6 +93,7 @@ Returns:
"channel": string
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.airport_s
jc - JSON CLI output utility airport -s Parser
@@ -84,11 +85,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -117,6 +120,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.arp
jc - JSON CLI output utility arp Parser
@@ -95,11 +96,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -128,6 +131,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.blkid
jc - JSON CLI output utility blkid Parser
@@ -75,11 +76,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -129,6 +132,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.crontab
jc - JSON CLI output utility crontab command and file Parser
@@ -128,11 +129,13 @@ Examples:
]
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -178,6 +181,7 @@ Returns:
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.crontab_u
jc - JSON CLI output utility crontab file Parser
@@ -129,11 +130,13 @@ Examples:
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -180,6 +183,7 @@ Returns:
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.csv
jc - JSON CLI output utility csv Parser
@@ -59,11 +60,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -86,6 +89,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.df
jc - JSON CLI output utility df Parser
@@ -69,11 +70,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -106,6 +109,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.dig
jc - JSON CLI output utility dig Parser
@@ -321,11 +322,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -393,6 +396,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.dmidecode
jc - JSON CLI output utility dmidecode Parser
@@ -99,11 +100,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -134,6 +137,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.du
jc - JSON CLI output utility du Parser
@@ -69,11 +70,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -96,6 +99,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.env
jc - JSON CLI output utility env Parser
@@ -49,11 +50,13 @@ Examples:
"_": "/usr/bin/env"
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -76,6 +79,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.file
jc - JSON CLI output utility file command Parser
@@ -44,11 +45,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -71,6 +74,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.free
jc - JSON CLI output utility free Parser
@@ -49,11 +50,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -81,6 +84,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.fstab
jc - JSON CLI output utility fstab Parser
@@ -67,11 +68,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -98,6 +101,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.group
jc - JSON CLI output utility /etc/group file Parser
@@ -91,11 +92,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -122,6 +125,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.gshadow
jc - JSON CLI output utility /etc/gshadow file Parser
@@ -57,11 +58,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -90,6 +93,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.history
jc - JSON CLI output utility history Parser
@@ -41,11 +42,13 @@ Examples:
...
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -68,6 +71,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.hosts
jc - JSON CLI output utility hosts Parser
@@ -58,11 +59,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -87,6 +90,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.id
jc - JSON CLI output utility id Parser
@@ -67,11 +68,13 @@ Examples:
}
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -114,6 +117,7 @@ Returns:
}
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.ifconfig
jc - JSON CLI output utility ifconfig Parser
@@ -142,19 +143,16 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## IfconfigParser
```python
IfconfigParser(self, console_output)
```
## InterfaceNotFound
```python
InterfaceNotFound(self, /, *args, **kwargs)
IfconfigParser(console_output)
```
@@ -206,6 +204,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.ini
jc - JSON CLI output utility INI Parser
@@ -45,11 +46,13 @@ Examples:
}
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -73,6 +76,7 @@ Returns:
If you would like to keep the quotation marks, use the -r or raw=True argument.
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.iptables
jc - JSON CLI output utility ipables Parser
@@ -131,11 +132,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -172,6 +175,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.jobs
jc - JSON CLI output utility jobs Parser
@@ -73,11 +74,13 @@ Example:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -103,6 +106,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

61
docs/parsers/kv.md Normal file
View File

@@ -0,0 +1,61 @@
# jc.parsers.kv
jc - JSON CLI output utility Key/Value File Parser
Usage:
Specify --kv as the first argument if the piped input is coming from a simple
key/value pair file. Delimiter can be '=' or ':'. Missing values are supported.
Comment prefix can be '#' or ';'. Comments must be on their own line.
Compatibility:
'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'
Examples:
$ cat keyvalue.txt
# this file contains key/value pairs
name = John Doe
address=555 California Drive
age: 34
; comments can include # or ;
# delimiter can be = or :
# quoted values have quotation marks stripped by default
# but can be preserved with the -r argument
occupation:"Engineer"
$ cat keyvalue.txt | jc --ini -p
{
"name": "John Doe",
"address": "555 California Drive",
"age": "34",
"occupation": "Engineer"
}
## info
```python
info()
```
## parse
```python
parse(data, raw=False, quiet=False)
```
Main text parsing function
Note: this is just a wrapper for jc.parsers.ini
Parameters:
data: (string) text data to parse
raw: (boolean) output preprocessed JSON if True
quiet: (boolean) suppress warning messages if True
Returns:
Dictionary representing the key/value file

View File

@@ -1,3 +1,4 @@
# jc.parsers.last
jc - JSON CLI output utility last Parser
@@ -68,11 +69,13 @@ Examples:
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -99,6 +102,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.ls
jc - JSON CLI output utility ls Parser
@@ -145,11 +146,13 @@ Examples:
"date": "May 3 2019"
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -178,6 +181,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.lsblk
jc - JSON CLI output utility lsblk Parser
@@ -212,11 +213,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -277,6 +280,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.lsmod
jc - JSON CLI output utility lsmod Parser
@@ -103,11 +104,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -134,6 +137,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.lsof
jc - JSON CLI output utility lsof Parser
@@ -93,11 +94,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -128,6 +131,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.mount
jc - JSON CLI output utility mount Parser
@@ -53,11 +54,13 @@ Example:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -84,6 +87,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.netstat
jc - JSON CLI output utility netstat Parser
@@ -245,11 +246,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -364,6 +367,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.ntpq
jc - JSON CLI output utility ntpq Parser
@@ -179,11 +180,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -216,6 +219,7 @@ Returns:
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.passwd
jc - JSON CLI output utility /etc/passwd file Parser
@@ -75,11 +76,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -107,6 +110,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.ping
jc - JSON CLI output utility ping Parser
@@ -104,11 +105,13 @@ Examples:
]
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -152,6 +155,7 @@ Returns:
]
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.pip_list
jc - JSON CLI output utility pip-list Parser
@@ -28,11 +29,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -56,6 +59,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.pip_show
jc - JSON CLI output utility pip-show Parser
@@ -39,11 +40,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -75,6 +78,7 @@ Returns:
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.ps
jc - JSON CLI output utility ps Parser
@@ -173,11 +174,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -215,6 +218,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.route
jc - JSON CLI output utility route Parser
@@ -80,11 +81,13 @@ Examples:
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -119,6 +122,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.shadow
jc - JSON CLI output utility /etc/shadow file Parser
@@ -81,11 +82,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -114,6 +117,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.ss
jc - JSON CLI output utility ss Parser
@@ -247,11 +248,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -289,6 +292,7 @@ Returns:
Information from https://www.cyberciti.biz/files/ss.html used to define field names
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.stat
jc - JSON CLI output utility stat Parser
@@ -101,11 +102,13 @@ Examples:
..
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -149,6 +152,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.sysctl
jc - JSON CLI output utility sysctl -a Parser
@@ -39,11 +40,13 @@ Examples:
...
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -65,6 +68,7 @@ Returns:
"baz": string/integer/float
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.systemctl
jc - JSON CLI output utility systemctl Parser
@@ -37,11 +38,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -67,6 +70,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.systemctl_lj
jc - JSON CLI output utility systemctl-lj Parser
@@ -56,11 +57,13 @@ Examples:
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -85,6 +88,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.systemctl_ls
jc - JSON CLI output utility systemctl-ls Parser
@@ -31,11 +32,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -59,6 +62,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.systemctl_luf
jc - JSON CLI output utility systemctl-luf Parser
@@ -28,11 +29,13 @@ Examples:
...
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -55,6 +58,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.timedatectl
jc - JSON CLI output utility timedatectl Parser
@@ -35,11 +36,13 @@ Examples:
"dst_active": "yes"
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -68,6 +71,7 @@ Returns:
"dst_active": boolean
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.tracepath
jc - JSON CLI output utility tracepath Parser
@@ -102,11 +103,13 @@ Examples:
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -139,6 +142,7 @@ Returns:
]
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.traceroute
jc - JSON CLI output utility traceroute Parser
@@ -84,16 +85,19 @@ Examples:
]
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## Hop
```python
Hop(self, idx)
Hop(idx)
```
## process
```python
process(proc_data)
@@ -128,6 +132,7 @@ Returns:
]
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.uname
jc - JSON CLI output utility uname Parser
@@ -27,11 +28,13 @@ Example:
"kernel_version": "#74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019"
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -58,6 +61,7 @@ Returns:
"kernel_version": string
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.uptime
jc - JSON CLI output utility uptime Parser
@@ -31,11 +32,13 @@ Example:
"load_15m": "0.05"
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -60,6 +63,7 @@ Returns:
"load_15m": float
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.w
jc - JSON CLI output utility w Parser
@@ -79,11 +80,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -112,6 +115,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.who
jc - JSON CLI output utility who Parser
@@ -99,11 +100,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -133,6 +136,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.xml
jc - JSON CLI output utility XML Parser
@@ -55,11 +56,13 @@ Examples:
...
}
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -80,6 +83,7 @@ Returns:
See https://github.com/martinblech/xmltodict for details
}
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc.parsers.yaml
jc - JSON CLI output utility YAML Parser
@@ -67,11 +68,13 @@ Examples:
}
]
## info
```python
info(self, /, *args, **kwargs)
info()
```
## process
```python
process(proc_data)
@@ -94,6 +97,7 @@ Returns:
}
]
## parse
```python
parse(data, raw=False, quiet=False)

View File

@@ -1,3 +1,4 @@
# jc
JC - JSON CLI output utility

View File

@@ -1,5 +1,7 @@
# utils
jc - JSON CLI output utility utils
## warning_message
```python
warning_message(message)
@@ -15,6 +17,7 @@ Returns:
no return, just prints output to STDERR
## error_message
```python
error_message(message)
@@ -30,6 +33,7 @@ Returns:
no return, just prints output to STDERR
## compatibility
```python
compatibility(mod_name, compatible)
@@ -48,6 +52,7 @@ Returns:
no return, just prints output to STDERR
## has_data
```python
has_data(data)