Created
April 6, 2021 19:12
-
-
Save miohtama/5cf92891b3b594ff3c01a14961fdea6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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