@nasa-jpl/seq-json-schema

1.0.21 • Public • Published

npm (scoped) PyPI

seq-json-schema

Standardized JSON Schema for authoring multi-mission sequences. You can read the schema definition here.
You can use our validation site to validate a .seq.json document against the latest schema.

JavaScript or TypeScript

Install

npm install @nasa-jpl/seq-json-schema --save

Basic Usage

import seqSchema from '@nasa-jpl/seq-json-schema/schema.json' assert { type: 'json' };
console.log(seqSchema);

TypeScript Types

This library also ships with automatically generated TypeScript types from the schema. For example:

import type { Command, SeqJson } from '@nasa-jpl/seq-json-schema/types';

const command: Command = {
  args: [],
  stem: 'SEND_DATA',
  time: { type: 'COMMAND_COMPLETE' },
  type: 'command',
};

const seqJson: SeqJson = {
  id: 'sequence0',
  metadata: {},
  steps: [command],
};

console.log(seqJson);

Python

Install

pip install seq-json-schema

Basic Usage

import importlib.resources
import json

with importlib.resources.path('seq-json-schema', 'schema.json') as schemaPath:
  file = open(schemaPath)
  schema = json.load(file)
  print(schema)

Note if you are using a Python version lower than 3.7 you will have to import the schema using the importlib-resources library.

Readme

Keywords

none

Package Sidebar

Install

npm i @nasa-jpl/seq-json-schema

Weekly Downloads

104

Version

1.0.21

License

MIT

Unpacked Size

31.5 kB

Total Files

5

Last publish

Collaborators

  • dandelany
  • mattdailis
  • duranb
  • aplave
  • jaray
  • laespinoza
  • stephiescastle
  • scotchester
  • nasa-jpl.www.developers