Brainfuck compressor in Python
Since you seem to want code golf over readable code this may not be the answer you want. All the suggestions I make are things I would prefer, but I don't think it's that uncommon for others to disagree. The outcome either way is still pretty ugly.


Your code isn't PEP 8 compliant, and is generally pretty hard to read.
Your one-line docstrings are quite poor, docstring wise. Contrast with:


"""Compress Brainfuck code to TinyBF"""


Use str.maketrans rather than manually make the translation table.

COMPRESS_TABLE = str.maketrans({'&gt;': '2', '&lt;': '3', '+': '4', '-': '5', '.': '6', ',': '7', '[': '8', ']': '9'})


Alturnately you can define both from a common string.

_COMPRESS_STR = '&gt;2 &lt;3 +4 -5 .6 ,7 [8 ]9'
COMPRESS_TABLE = str.maketrans(dict(_COMPRESS_STR.split()))
DECOMPRESS_TABLE = str.maketrans(dict(_COMPRESS_STR[::-1].split()))

I would prefer itertools.zip_longest over manually zipping and justifying.
You can split decompress over multiple lines to make the code more readable.


import itertools

_COMPRESS_STR = '&gt;2 &lt;3 +4 -5 .6 ,7 [8 ]9'
COMPRESS_TABLE = str.maketrans(dict(_COMPRESS_STR.split()))
DECOMPRESS_TABLE = str.maketrans(dict(_COMPRESS_STR[::-1].split()))


def compress(code: str) -&gt; str:
    """Compress Brainfuck code into TinyBF"""
    return "".join(
        chr(int(a + b))
        for a, b in itertools.zip_longest(
            *2*[iter(code.translate(COMPRESS_TABLE))],
            fillvalue="0",
        )
    )


def decompress(code: str) -&gt; str:
    """Decompress TinyBF into Brainfuck"""
    return (
        "".join(str(ord(c)) for c in code)
            .translate(DECOMPRESS_TABLE)
            .rstrip("0")
    )