Python With Jedi

pip install jedi
import jedi, json, numpy
source = '''
import numpy
numpy.b'''
s = jedi.Script(source, 3, len('numpy.a'), 'example.py')
list(map(lambda c: c.name, s.completions()))
import sys

sys.version
a = {}
d = {'foo': a}
a.update({'a': 1})
d

import base64
base64.b64encode(b"import numpy\nnumpy.a")
© 2018 Nextjournal GmbH