def split_codons(sequence, reading_frame_offset=0, reading_frame_direction=1):
    """
    Returns a list of 3-character strings representing codons extracted from a sequence of DNA characters
    at a specified offset (0,1,2) and direction (-1 or 1)
    """
    assert reading_frame_offset in (0, 1, 2)
    assert reading_frame_direction in (-1, 1)
    codons = []
    num_codons = int((len(sequence) - reading_frame_offset) / 3)
    for codon in range(num_codons):
        codons.append(sequence[codon * 3 + reading_frame_offset:(codon + 1) *
            3 + reading_frame_offset])
    return codons
