Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def _console(context: ProcessContext):
imported_objects = {}
import datetime
from IPython import embed
from dex_ohlcv.models.base import Base
imported_objects["db_session_scoper"] = context.create_db_session_scoper()
imported_objects["web3"] = context.create_web3()
imported_objects["datetime"] = datetime
for name, cls in Base._decl_class_registry.items():
if name == "_sa_module_registry":
continue
imported_objects[name] = cls
print('')
print('Following classes and objects are available:')
for var, val in imported_objects.items():
line = "{key:30}: {value}".format(
key=var,
value=str(val).replace('\n', ' ').replace('\r', ' ')
)
print(line)
print('')
embed(user_ns=imported_objects, colors="Linux")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment