Ejemplo n.º 1
0
def stats(name):
    response = {}
    norm = utils.normalize_name(name)
    verbose = request.args.get("verbose", None)
    if verbose and verbose == "true":
        response["normalized"] = norm
    counts = models.USName.query.get_or_404(norm)
    response["given_male"] = counts.p_given_male()
    return jsonify(response)
Ejemplo n.º 2
0
def normalize(string):
    """Normalize a string for DB lookups.
    """
    return jsonify({
        "normalized": utils.normalize_name(string)
    })