Example #1
0
def validate(*params):
    parser = parser_validate()
    results = parser.parse_args(params)

    from boutiques.validator import validate_descriptor
    descriptor = validate_descriptor(results.descriptor,
                                     format_output=results.format)
    if results.bids:
        from boutiques.bids import validate_bids
        validate_bids(descriptor, valid=True)
Example #2
0
def validate(*params):
    parser = ArgumentParser("Boutiques descriptor validator")
    parser.add_argument("descriptor",
                        action="store",
                        help="The Boutiques descriptor.")
    parser.add_argument("--bids",
                        "-b",
                        action="store_true",
                        help="Flag indicating if descriptor is a BIDS app")
    results = parser.parse_args(params)

    from boutiques.validator import validate_descriptor
    descriptor = validate_descriptor(results.descriptor)
    if results.bids:
        from boutiques.bids import validate_bids
        validate_bids(descriptor, valid=True)
Example #3
0
def main(args=None):
    parser = ArgumentParser("Boutiques Validator")
    parser.add_argument("jsonfile",
                        action="store",
                        help="The Boutiques descriptor you wish to validate")
    parser.add_argument("--bids",
                        "-b",
                        action="store_true",
                        help="Flag indicating if descriptor is for a BIDS app")
    results = parser.parse_args() if args is None else parser.parse_args(args)

    descriptor = validate_json(results.jsonfile)

    if results.bids:
        from boutiques.bids import validate_bids
        validate_bids(descriptor, valid=True)
        return 0
Example #4
0
def validate(*params):
    parser = ArgumentParser("Boutiques descriptor validator")
    parser.add_argument("descriptor", action="store",
                        help="The Boutiques descriptor as a JSON file, JSON "
                             "string or Zenodo ID (prefixed by 'zenodo.').")
    parser.add_argument("--bids", "-b", action="store_true",
                        help="Flag indicating if descriptor is a BIDS app")
    parser.add_argument("--format", "-f", action="store_true",
                        help="If descriptor is valid, rewrite it with sorted"
                        " keys.")
    results = parser.parse_args(params)

    from boutiques.validator import validate_descriptor
    descriptor = validate_descriptor(results.descriptor,
                                     format_output=results.format)
    if results.bids:
        from boutiques.bids import validate_bids
        validate_bids(descriptor, valid=True)