Skip to content

Commit

Permalink
Added combo rules _less and _greater and HUGE docs refactoring (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Mar 25, 2024
1 parent 5968a7e commit 758711c
Show file tree
Hide file tree
Showing 86 changed files with 1,813 additions and 1,230 deletions.
264 changes: 155 additions & 109 deletions README.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

270 changes: 157 additions & 113 deletions schema-examples/full.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name" : "CSV Blueprint Schema Example",
"description" : "This YAML file provides a detailed description and validation rules for CSV files\nto be processed by JBZoo\/Csv-Blueprint tool. It includes specifications for file name patterns,\nCSV formatting options, and extensive validation criteria for individual columns and their values,\nsupporting a wide range of data validation rules from basic type checks to complex regex validations.\nThis example serves as a comprehensive guide for creating robust CSV file validations.\n",

"filename_pattern" : "\/demo(-\\d+)?\\.csv$\/i",

"csv" : {
"header" : true,
"delimiter" : ",",
Expand All @@ -10,11 +12,13 @@
"encoding" : "utf-8",
"bom" : false
},

"columns" : [
{
"name" : "Column Name (header)",
"description" : "Lorem ipsum",
"example" : "Some example",

"rules" : {
"not_empty" : true,
"exact_value" : "Some string",
Expand All @@ -23,43 +27,53 @@

"regex" : "\/^[\\d]{2}$\/",

"length" : 5,
"length_not" : 4,
"length_min" : 1,
"length_max" : 10,
"length_greater" : 2,
"length_not" : 0,
"length" : 7,
"length_less" : 8,
"length_max" : 9,

"is_trimmed" : true,
"is_lowercase" : true,
"is_uppercase" : true,
"is_capitalize" : true,

"word_count" : 5,
"word_count_not" : 4,
"word_count_min" : 1,
"word_count_max" : 10,
"word_count_greater" : 2,
"word_count_not" : 0,
"word_count" : 7,
"word_count_less" : 8,
"word_count_max" : 9,

"contains" : "Hello",
"contains_one" : ["a", "b"],
"contains_all" : ["a", "b", "c"],
"starts_with" : "prefix ",
"ends_with" : " suffix",

"num" : 5,
"num_not" : 4.123,
"num_min" : -10.123,
"num_max" : 1.2e3,
"num_min" : 1,
"num_greater" : 2,
"num_not" : 5,
"num" : 7,
"num_less" : 8,
"num_max" : 9,
"is_int" : true,
"is_float" : true,

"precision" : 5,
"precision_not" : 4,
"precision_min" : 1,
"precision_max" : 10,

"date" : "01 Jan 2000",
"precision_greater" : 2,
"precision_not" : 0,
"precision" : 7,
"precision_less" : 8,
"precision_max" : 9,

"date_min" : "-100 years",
"date_greater" : "-99 days",
"date_not" : "2006-01-02 15:04:05 -0700 Europe\/Rome",
"date_min" : "+1 day",
"date_max" : "now",
"date" : "01 Jan 2000",
"date_less" : "now",
"date_max" : "+1 day",
"date_format" : "Y-m-d",
"is_date" : true,

Expand All @@ -73,7 +87,6 @@
"is_currency_code" : true,
"is_base64" : true,
"is_json" : true,

"is_latitude" : true,
"is_longitude" : true,
"is_geohash" : true,
Expand All @@ -83,108 +96,139 @@
"country_code" : "alpha-2",
"language_code" : "alpha-2"
},

"aggregate_rules" : {
"is_unique" : true,

"first_num" : 5,
"first_num_not" : 4.123,
"first_num_min" : -1,
"first_num_max" : 20000,
"first" : "Expected",
"first_not" : "Not Expected",

"nth_num" : [2, 5],
"nth_num_not" : [2, 4.123],
"nth_num_min" : [2, -1],
"nth_num_max" : [2, 20000],
"nth" : [2, "Expected"],
"nth_not" : [2, "Not expected"],

"last_num" : 5,
"last_num_not" : 4.123,
"last_num_min" : -1,
"last_num_max" : 20000,
"last" : "Expected",
"last_not" : "Not Expected",

"sum" : 5.123,
"sum_not" : 4.123,
"sum_min" : 1.123,
"sum_max" : 10.123,

"average" : 5.123,
"average_not" : 4.123,
"average_min" : 1.123,
"average_max" : 10.123,

"count" : 5,
"count_not" : 4,
"count_min" : 1,
"count_max" : 10,

"count_empty" : 5,
"count_empty_not" : 4,
"count_empty_min" : 1,
"count_empty_max" : 10,

"count_not_empty" : 5,
"count_not_empty_not" : 4,
"count_not_empty_min" : 1,
"count_not_empty_max" : 10,

"median" : 5.123,
"median_not" : 4.123,
"median_min" : 1.123,
"median_max" : 10.123,

"percentile" : [95, 1.234],
"percentile_not" : [95, 4.123],
"percentile_min" : [95, -1],
"percentile_max" : [95, 20000],

"mean_abs_dev" : 5.123,
"mean_abs_dev_not" : 4.123,
"mean_abs_dev_min" : 1.123,
"mean_abs_dev_max" : 10.123,

"median_abs_dev" : 5.123,
"median_abs_dev_not" : 4.123,
"median_abs_dev_min" : 1.123,
"median_abs_dev_max" : 10.123,

"population_variance" : 5.123,
"population_variance_not" : 4.123,
"population_variance_min" : 1.123,
"population_variance_max" : 10.123,

"sample_variance" : 5.123,
"sample_variance_not" : 4.123,
"sample_variance_min" : 1.123,
"sample_variance_max" : 10.123,

"stddev" : 5.123,
"stddev_not" : 4.123,
"stddev_min" : 1.123,
"stddev_max" : 10.123,

"stddev_pop" : 5.123,
"stddev_pop_not" : 4.123,
"stddev_pop_min" : 1.123,
"stddev_pop_max" : 10.123,

"coef_of_var" : 5.123,
"coef_of_var_not" : 4.123,
"coef_of_var_min" : 1.123,
"coef_of_var_max" : 10.123
"is_unique" : true,

"first_num_min" : 1,
"first_num_greater" : 2,
"first_num_not" : 5,
"first_num" : 7,
"first_num_less" : 8,
"first_num_max" : 9,
"first" : "Expected",
"first_not" : "Not Expected",

"nth_num_min" : [42, 1],
"nth_num_greater" : [42, 2],
"nth_num_not" : [42, 5],
"nth_num" : [42, 7],
"nth_num_less" : [42, 8],
"nth_num_max" : [42, 9],
"nth" : [2, "Expected"],
"nth_not" : [2, "Not expected"],

"last_num_min" : 1,
"last_num_greater" : 2,
"last_num_not" : 5,
"last_num" : 7,
"last_num_less" : 8,
"last_num_max" : 9,
"last" : "Expected",
"last_not" : "Not Expected",

"sum_min" : 1,
"sum_greater" : 2,
"sum_not" : 5,
"sum" : 7,
"sum_less" : 8,
"sum_max" : 9,

"average_min" : 1,
"average_greater" : 2,
"average_not" : 5,
"average" : 7,
"average_less" : 8,
"average_max" : 9,

"count_min" : 1,
"count_greater" : 2,
"count_not" : 0,
"count" : 7,
"count_less" : 8,
"count_max" : 9,

"count_empty_min" : 1,
"count_empty_greater" : 2,
"count_empty_not" : 0,
"count_empty" : 7,
"count_empty_less" : 8,
"count_empty_max" : 9,

"count_not_empty_min" : 1,
"count_not_empty_greater" : 2,
"count_not_empty_not" : 0,
"count_not_empty" : 7,
"count_not_empty_less" : 8,
"count_not_empty_max" : 9,

"median_min" : 1,
"median_greater" : 2,
"median_not" : 5,
"median" : 7,
"median_less" : 8,
"median_max" : 9,

"percentile_min" : [95, 1],
"percentile_greater" : [95, 2],
"percentile_not" : [95, 5],
"percentile" : [95, 7],
"percentile_less" : [95, 8],
"percentile_max" : [95, 9],

"mean_abs_dev_min" : 1,
"mean_abs_dev_greater" : 2,
"mean_abs_dev_not" : 5,
"mean_abs_dev" : 7,
"mean_abs_dev_less" : 8,
"mean_abs_dev_max" : 9,

"median_abs_dev_min" : 1,
"median_abs_dev_greater" : 2,
"median_abs_dev_not" : 5,
"median_abs_dev" : 7,
"median_abs_dev_less" : 8,
"median_abs_dev_max" : 9,

"population_variance_min" : 1,
"population_variance_greater" : 2,
"population_variance_not" : 5,
"population_variance" : 7,
"population_variance_less" : 8,
"population_variance_max" : 9,

"sample_variance_min" : 1,
"sample_variance_greater" : 2,
"sample_variance_not" : 5,
"sample_variance" : 7,
"sample_variance_less" : 8,
"sample_variance_max" : 9,

"stddev_min" : 1,
"stddev_greater" : 2,
"stddev_not" : 5,
"stddev" : 7,
"stddev_less" : 8,
"stddev_max" : 9,

"stddev_pop_min" : 1,
"stddev_pop_greater" : 2,
"stddev_pop_not" : 5,
"stddev_pop" : 7,
"stddev_pop_less" : 8,
"stddev_pop_max" : 9,

"coef_of_var_min" : 1,
"coef_of_var_greater" : 2,
"coef_of_var_not" : 5,
"coef_of_var" : 7,
"coef_of_var_less" : 8,
"coef_of_var_max" : 9
}
},

{
"name" : "another_column",
"rules" : {"not_empty" : true}
},

{
"name" : "third_column",
"rules" : {"not_empty" : true}
Expand Down

0 comments on commit 758711c

Please sign in to comment.