Source

audrid / audrid / utils.py

Full commit
# coding: utf-8

import datetime
import random
import string

def random_id(length=6):
    """ Return a random char identifier. 
    """
    return u''.join([ random.choice(
        string.lowercase + string.digits) for _ in range(length) ])

def random_id_fun(length=6):
    """ Return a random id generator.
    """
    def inner():
        return random_id(length=length)
    return inner

def isodate():
    return datetime.datetime.now().isoformat()