Skip to content
Permalink
Browse files
Added validation library
  • Loading branch information
mooshu1x2 committed May 12, 2016
1 parent 9229b2c commit f0b7ea105908ae628bfd164ce997a3400e6f822e
Showing 1 changed file with 29 additions and 0 deletions.
@@ -0,0 +1,29 @@
'''
distill: This package contains a flask app RESTful api for distill
This flask app exposes some restful api endpoints for querying User-ALE.
Very similar to Lucene syntax for basic query operations.
Copyright 2016, The Charles Stark Draper Laboratory
Licensed under Apache Software License.
'''

from distill.exceptions import ValidationError
import json, yaml

# doc = yaml.safe_load (msg)
# return json.dumps (doc, indent=4, separators=(',', ': '), sort_keys=True)


"""
Raises ValidationError
"""
def validate_request (q):
if 'q' not in q:
raise ValidationError ("Missing required parameter: %s" % 'q')
else:
# Handle rest of parsing
pass

def str2bool(v):
return v.lower() in ("yes", "true", "t", "1")

0 comments on commit f0b7ea1

Please sign in to comment.