Datacraft

Latest version: v0.9.0

Safety actively analyzes 622904 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

0.9.0

------

* Added `masked` type as alias for `regex_replace`. Added feature where single
value for data element is treated as replace all values with this e.g.

json
{
"ssn": {
"type": "masked",
"ref": "raw_ssn",
"data": "NNN-NN-NNNN"
},
"refs": {
"raw_ssn": ["123-45-6789", "555-55-5555"]
}
}

* Added `--endpoint-spec` argument. This specifies the path to a spec like file where each key
is an endpoint and each value is the spec to generate data for that endpoint e.g:

json
{
"/products/list": {
"product_id": { "type": "uuid" }
},
"/orders/recent": {
"order_id": { "type": "uuid" },
"customer_id": { "type": "uuid" }
}
}


Here when you run data craft with the arg `--endpoint-spec /path/to/epspec.json` the tool will spin up a flask server
with two endpoints one for `/products/list` and one for `/orders/recent`

* Added `--csv-select` option to infer-spec cli. This allows a csv file to be turned into a csv_select spec.
* Fixed broken `caclulate` type

0.8.1

------
* Fix for infer on multiple JSON files to combine them before inference
* Fix to handle nested Objects in inference

0.8.0

------
* added New `ref_list` type. For inject field values into positions in list/array objects.
* added `escape` and `escape_str` params for `char_class` types.
* Added new command line utility `infer-spec`. This will take example CSV or JSON data and will attempt to infer a
Data Spec from the examples. This can be used to bootstrap Data Spec generation.

shell
$ head -5 test.csv
ip,lat,long,city,date
192.168.1.1,34.0522,-118.2437,Los Angeles,2023-10-08T08:45:00
192.168.1.2,40.7306,-73.9352,New York,2023-10-08T09:15:23
192.168.1.3,51.5074,-0.1278,London,2023-10-08T10:32:50
192.168.1.4,48.8566,2.3522,Paris,2023-10-08T11:05:31

shell
$ infer-spec --csv examples.csv
INFO [09-Oct-2023 09:20:37 AM] Processing examples.csv...
{
"ip": {
"type": "ip",
"config": {
"base": "192.168.1"
}
},
"lat": {
"type": "geo.lat"
},
"long": {
"type": "geo.long"
},
"city": {
"type": "values",
"data": [
"London",
"Los Angeles",
"Vancouver",
"New Delhi",
"Paris",
"New York",
"Tokyo",
"San Francisco",
"Berlin",
"Chicago"
]
},
"date": {
"type": "date.iso"
}
}

0.7.3

------
* added --server-port option

0.7.2

------
* Fix to allow POST and GET for server end points
* Fix for count as list for values objects
* Added --server-delay arg to add option delay between requests and response in seconds

0.7.1

------
* Added py.typed to get type hint support to dependent projects

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.