Maybe in this case would be better, request a feature of dot file generator in
nimble, then link would be only a encoding process
import zlib
import base64
import string
plantuml_alphabet = string.digits + string.ascii_uppercase +
string.ascii_lowercase + '-_'
base64_alphabet = string.ascii_uppercase + string.ascii_lowercase +
string.digits + '+/'
b64_to_plantuml = bytes.maketrans(base64_alphabet.encode('utf-8'),
plantuml_alphabet.encode('utf-8'))
plantuml_url = 'http://www.plantuml.com/plantuml/uml/'
def encode_url(graph_code):
compressed = zlib.compress(graph_code.encode('utf-8'))
hashed =
base64.b64encode(compressed[2:-4]).translate(b64_to_plantuml).decode('utf-8')
return plantuml_url + hashed
Run