Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hgrsd committed Apr 3, 2024
1 parent 638ab1a commit ae0ee90
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "drivel"
description = "Infer a schema from JSON input, and generate synthetic data based on the inferred schema."
license = "MIT"
authors = ["Daniël Hogers <[email protected]>"]
version = "0.1.11"
version = "0.1.12"
edition = "2021"
repository = "https://github.com/hgrsd/drivel"

Expand Down
29 changes: 2 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# drivel

`drivel` is a command-line tool written in Rust for inferring a schema from an example JSON (or JSON lines) file, and generating synthetic data (the drivel in question)
`drivel` is a command-line tool written in Rust for inferring a schema from an example JSON (or JSON lines) file, and generating synthetic data (the drivel in question)
based on the inferred schema.

## Features
Expand Down Expand Up @@ -40,31 +40,6 @@ Options:
-V, --version Print version
```

### Describe

In 'describe' mode, drivel infers the schema from the input JSON and prints a human-readable description of the schema. This mode is useful for understanding the structure and data types present in JSON data.

```sh
cat input.json | drivel describe
```

### Produce

In 'produce' mode, drivel infers the schema from the input JSON, generates synthetic data based on the inferred schema, and outputs the generated data in JSON format. This is useful for generating test data or sample datasets.

At present, drivel is moderately smart about schema inference. It makes some attempt at inferring semantic meaning for fields, particularly for String types,
but it is fairly limited at doing this. I would welcome any work to improve drivel's ability to understand the data it sees, to have more semantic understanding baked into the generated schema.

```sh
cat input.json | drivel produce
```

You can also specify the number of times to repeat the generated data:

```sh
cat input.json | drivel produce 5
```

## Examples

Consider a JSON file `input.json`:
Expand Down Expand Up @@ -110,7 +85,7 @@ Output:
Running drivel in 'produce' mode:

```sh
cat input.json | drivel produce 3
cat input.json | drivel produce -n 3
```

Output:
Expand Down

0 comments on commit ae0ee90

Please sign in to comment.