##// END OF EJS Templates
Add isvalid function which returns True/False
Jessica B. Hamrick -
Show More
@@ -14,6 +14,11 b' schema_path = os.path.join('
14 os.path.split(__file__)[0], "v%d" % nbformat, nbformat_schema)
14 os.path.split(__file__)[0], "v%d" % nbformat, nbformat_schema)
15
15
16
16
17 def isvalid(nbjson, key='/notebook', verbose=False):
18 errors = validate(nbjson, key=key, verbose=verbose)
19 return errors == 0
20
21
17 def validate(nbjson, key='/notebook', verbose=False):
22 def validate(nbjson, key='/notebook', verbose=False):
18 # load the schema file
23 # load the schema file
19 with open(schema_path, 'r') as fh:
24 with open(schema_path, 'r') as fh:
General Comments 0
You need to be logged in to leave comments. Login now