twosigma/widget-gen

Name: widget-gen

Owner: Two Sigma

Description: A node package for generating jupyter widget definitions from a JSON schema

Created: 2018-04-02 14:41:26.0

Updated: 2018-05-21 14:26:12.0

Pushed: 2018-05-21 14:26:10.0

Homepage: null

Size: 109

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

widget-gen

Npm version Travis build status codecov

This is a utility library for auto-generating jupyter widget definitions based on the synchronization state. Any bussiness logic will have to be added on top, but this utility can help with:

The last point is best accomplished by using the auto-generated definitions as base classes for the classes that actually add the business logic.

It can read (parse) widget definitions from:

And then output corresponding code in the following languages:

Installation
install [-g] widget-gen
Usage
dgetgen --help
age: main [options] <file> [languages...]

tions:

-V, --version                output the version number
-p, --parser [parser]        The name of the parser to use, either "json" or "python".
-o, --outputdir [outputdir]  The output directory.
-t, --template [template]    a template file to use.
-e, --extension [extension]  The file extension to use for the output.
-h, --help                   output usage information
Extending language support

To add support for other output languages, you need to add another Writer class. You can either do this by inherting the base Writer class, having full control of the process, or you can inherit the TemplateWriter class that will use Nunjucks templates for creating output.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.