Skip to content

Commit 9b03e2f

Browse files
author
Tom Reitz
committed
update docs
1 parent 5bf02dc commit 9b03e2f

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ count:
6464
separator: ,
6565
fetch:
6666
page_size: 100
67+
validate:
68+
methods:
69+
- schema # checks that payloads conform to the Swagger definitions from the API
70+
- descriptors # checks that descriptor values are either locally-defined or exist in the remote API
71+
- uniqueness # checks that local payloads are unique by the required property values
72+
- references # checks that references resolve, either locally or in the remote API
73+
# or `methods: "*"`
74+
references:
75+
selector:
76+
- studentAssessments.studentReference
77+
- studentSchoolAssociations.schoolReference
78+
behavior: exclude # or `include`
79+
remote: False # default=True
6780
force_delete: True
6881
log_level: INFO
6982
show_stacktrace: True
@@ -94,6 +107,7 @@ show_stacktrace: True
94107
* (optional) Whether to `verify_ssl`. The default is `True`. Set to `False` when working with `localhost` APIs or to live dangerously.
95108
* (optional) for [`lightbeam count`](#count), optionally change the `separator` between `Records` and `Endpoint`. The default is a "tab" character.
96109
* (optional) for [`lightbeam fetch`](#fetch), optionally specify the number of records (`page_size`) to GET at a time. The default is 100, but if you're trying to extract lots of data from an API increase this to the largest allowed (which depends on the API, but is often 500 or even 5000).
110+
* (optional) for [`lightbeam validate`](#validate), optionally specify the list of validation `methods` to run (from `schema`, `descriptors`, `uniqueness`, and `references`). If validating `references`, specify a list of `selector`s to either `include` or `exclude` (`behavior`) when validating. Also optionally disable `remote` referece validation (enabled by default).
97111
* (optional) Skip the interactive confirmation prompt (for programmatic use) when using the [`delete`](#delete) command. The default is `False` (prompt).
98112
* (optional) Specify a `log_level` for output. Possible values are
99113
- `ERROR`: only output errors like missing required sources, invalid references, invalid [YAML configuration](#yaml-configuration), etc.
@@ -217,6 +231,17 @@ Running the `truncate` command will prompt you to type "yes" to confirm. This co
217231

218232
`truncate` is a convenience command which should be used sparingly, as it can generate large numbers of `deletes` records and cause performance issues when pulling from `deletes` endpoints. If you want to wipe an entire Ed-Fi ODS, a better approach may be to drop and recreate the database (and re-send Descriptors and other default resources as needed).
219233

234+
## `create`
235+
```bash
236+
lightbeam create -s students,schools,studentSchoolAssociations -c path/to/config.yaml
237+
```
238+
Creates a skeleton of an [`earthmover`](https://edanalytics.github.io/earthmover/) project for _creating_ JSONL Ed-Fi data which one can then `lightbeam send` to an Ed-Fi API. It uses the Ed-Fi API's [OpenAPI specification](https://spec.openapis.org/oas/latest.html) to determine the schema of the endpoints you select (`lightbeam create` should usually be used with the `-s` [selector](#selectors)). Then, in the current directory, it:
239+
* creates (if it doesn't already exist, otherwise adds/overwrites) a partial `earthmover.yml` configuration file with empty `sources` and `transformations` but `destinations` for each selected endpoint, plus comments indicating what column names and data types/values are required, and the required grain of the table (based on `isIdentity` flags in the OpenAPI definitions)
240+
* creates (or overwrites) `templates/*.jsont` for each selected endpoint, with skeleton Jinja-JSON that includes all the required fields (including nested ones), optional fields wrapped in conditionals, and comments with some of the property metadata from OpenAPI definitions, such as `type`, `description`, `isIdentity`, etc.
241+
242+
The purpose of `lightbeam create` is to save developers time if they want to use `earthmover` to create Ed-Fi-shaped data from other data sources. See the [`earthmover` documentation](https://edanalytics.github.io/earthmover/) for more information.
243+
244+
220245
## Other options
221246
See a help message with
222247
```bash
@@ -230,6 +255,14 @@ lightbeam -v
230255
lightbeam --version
231256
```
232257

258+
Override specific configurations in `lightbeam.yml` from the command-line using the `--set` flag
259+
```
260+
lightbeam fetch --set fetch.page_size 1000
261+
lightbeam validate --set log_level WARN show_stacktrace True
262+
lightbeam send --set connection.timeout 15
263+
```
264+
(`--set` must be followed by a set of key-value pairs.)
265+
233266
234267
# Features
235268
This tool includes several special features:

0 commit comments

Comments
 (0)