Skip to content

Commit c8a5996

Browse files
committed
Update CLI User Guide article
1 parent 0f41424 commit c8a5996

1 file changed

Lines changed: 46 additions & 25 deletions

File tree

docs/user-guide/cli.qmd

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ toc-expand: 2
55

66
# Command Line Interface
77

8-
Pointblank provides a powerful command-line interface (CLI) that allows you to perform data validation directly from the terminal without writing Python code. This is especially useful for:
8+
Pointblank provides a powerful command-line interface (CLI) that allows you to perform data
9+
validation directly from the terminal without writing Python code. This is especially useful for:
910

10-
- Quick data quality checks in CI/CD pipelines
11-
- Exploratory data analysis
12-
- Integration with shell scripts and automation workflows
13-
- Non-Python users who want to leverage Pointblank's validation capabilities
11+
- quick data quality checks in CI/CD pipelines
12+
- exploratory data analysis
13+
- integration with shell scripts and automation workflows
14+
- non-Python users who want to leverage Pointblank's validation capabilities
1415

1516
## Installation
1617

@@ -37,36 +38,56 @@ pb validate-simple [DATA_SOURCE] --check [CHECK_TYPE] [OPTIONS]
3738

3839
You can validate various types of data sources:
3940

40-
- CSV files: `pb validate-simple data.csv --check rows-distinct`
41-
- Parquet files: `pb validate-simple data.parquet --check col-vals-not-null --column age`
42-
- database tables: `pb validate-simple "duckdb:///path/to/db.ddb::table_name" --check rows-complete`
43-
- built-in datasets: `pb validate-simple small_table --check col-exists --column a`
41+
*CSV files*
42+
43+
```bash
44+
pb validate-simple data.csv --check rows-distinct
45+
```
46+
47+
*Parquet files*
48+
49+
```bash
50+
pb validate-simple data.parquet --check col-vals-not-null --column age
51+
```
52+
53+
*Database tables*
54+
55+
```bash
56+
pb validate-simple "duckdb:///path/to/db.ddb::table_name" --check rows-complete
57+
```
58+
59+
*built-in datasets*
60+
61+
```bash
62+
pb validate-simple small_table --check col-exists --column a
63+
```
4464

4565
## Available Validation Checks
4666

4767
### Data Completeness
4868

4969
- `rows-distinct`: Check if all rows are unique (no duplicates)
5070
- `rows-complete`: Check if all rows are complete (no missing values)
51-
- `col-vals-not-null`: Check if a column has no null/missing values
71+
- `col-vals-not-null`: Check if a column has no Null/None/NA values
5272

5373
### Column Existence
5474

5575
- `col-exists`: Verify that a specific column exists in the dataset
5676

57-
### Value Range Checks
77+
### Numeric Value Checks Within Columns
78+
79+
- `col-vals-gt`: column values greater than a fixed value
80+
- `col-vals-ge`: column values greater than or equal to a fixed value
81+
- `col-vals-lt`: column values less than a fixed value
82+
- `col-vals-le`: column values less than or equal to a fixed value
5883

59-
- `col-vals-gt`: Values greater than a threshold
60-
- `col-vals-ge`: Values greater than or equal to a threshold
61-
- `col-vals-lt`: Values less than a threshold
62-
- `col-vals-le`: Values less than or equal to a threshold
84+
### Value Set Checks Within Columns
6385

64-
### Value Set Checks
65-
- `col-vals-in-set`: Values must be in an allowed set
86+
- `col-vals-in-set`: column values must be in an defined set
6687

6788
## Examples
6889

69-
### Basic Validation
90+
#### Basic Validation
7091

7192
```bash
7293
# Check for duplicate rows
@@ -79,7 +100,7 @@ pb validate-simple data.csv --check col-vals-not-null --column age
79100
pb validate-simple data.csv --check col-vals-gt --column score --value 50
80101
```
81102

82-
### Range Validations
103+
#### Range Validations
83104

84105
```bash
85106
# Check if all ages are less than 100
@@ -93,14 +114,14 @@ pb validate-simple data.csv --check col-vals-ge --column rating --value 1
93114
pb validate-simple data.csv --check col-vals-le --column rating --value 5
94115
```
95116

96-
### Set Membership
117+
#### Set Membership
97118

98119
```bash
99120
# Check if status values are in allowed set
100121
pb validate-simple data.csv --check col-vals-in-set --column status --set "active,inactive,pending"
101122
```
102123

103-
### Debugging Failed Validations
124+
#### Debugging Failed Validations
104125

105126
Use `--show-extract` to see which rows are causing validation failures:
106127

@@ -112,7 +133,7 @@ pb validate-simple data.csv --check col-vals-lt --column age --value 65 --show-e
112133
pb validate-simple data.csv --check col-vals-not-null --column email --show-extract --limit 5
113134
```
114135

115-
### Exit Codes for Automation
136+
#### Exit Codes for Automation
116137

117138
Use `--exit-code` to make the command exit with a non-zero code when validation fails:
118139

@@ -123,7 +144,7 @@ pb validate-simple data.csv --check rows-distinct --exit-code
123144

124145
## Output Examples
125146

126-
### Successful Validation
147+
#### Successful Validation
127148

128149
```
129150
✓ Loaded data source: data.csv
@@ -148,7 +169,7 @@ Validation Result: Column Values Less Than
148169
╰─────────────────────────────────────────────────╯
149170
```
150171

151-
### Failed Validation
172+
#### Failed Validation
152173

153174
```
154175
✓ Loaded data source: data.csv
@@ -177,7 +198,7 @@ Validation Result: Column Values Less Than
177198

178199
## Integration with CI/CD
179200

180-
The CLI is perfect for integrating data validation into your CI/CD pipelines:
201+
The CLI is useful when integrating data validation into your CI/CD pipelines:
181202

182203
```yaml
183204
# Example GitHub Actions workflow

0 commit comments

Comments
 (0)