Datacraft

Latest version: v0.11.1

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

Scan your dependencies

Page 1 of 4

0.11.1

-------
* Added `iteration` and alias type `rownum`. This is used to indicate the number of the record that is being generated.

0.11.0

-------
* Addition of <date.type>.now e.g.

date.now
date.epoch.now
date.epoch.millis.now
date.epoch.ms.now
date.iso.now
date.iso.micros.now
date.iso.us.now
date.iso.millis.now
date.iso.ms.now

These give the date in the specified format for the current time on the local system.

0.10.2

-------
* Fix for `infer-spec` when data lists are empty

0.10.1

-------
* Added `--type-schema <type>` cli arg to print out the JSON schema for a specific type if defined
* Added `--server-host <HOST>` cli arg for specifying the Flask server host parameter
* Added abbreviations `--format j` for json and `--format jp` for json-pretty

0.10.0

-------
* Added `record_entries` and `record_generator` methods. These are used with to generate Data Classes instead of raw
dictionaries.
python
import datacraft

dataclass
class Entry:
id: str
timestamp: str
handle: str

raw_spec = {
"id": {"type": "uuid"},
"timestamp": {"type": "date.iso.millis"},
"handle": {"type": "cc-word", "config": { "min": 4, "max": 8, "prefix": "" } }
}
print(*datacraft.record_entries(Entry, raw_spec, 3), sep='\\n')
Entry(id='d5aeb7fa-374c-4228-8645-e8953165f163', timestamp='2024-07-03T04:10:10.016', handle='DAHQDSsF')
Entry(id='acde6f46-4692-45a7-8f0c-d0a8736c4386', timestamp='2024-07-06T17:43:36.653', handle='vBTf71sP')
Entry(id='4bb5542f-bf7d-4237-a972-257e24a659dd', timestamp='2024-08-01T03:06:49.724', handle='gzfY_akS')

* Fix for infer spec when nested objects are in a list

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

Page 1 of 4

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.