.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-python / pythonFiles / datascience / getJupyterVariableList.py
diff --git a/.config/coc/extensions/node_modules/coc-python/pythonFiles/datascience/getJupyterVariableList.py b/.config/coc/extensions/node_modules/coc-python/pythonFiles/datascience/getJupyterVariableList.py
new file mode 100644 (file)
index 0000000..ff88f19
--- /dev/null
@@ -0,0 +1,13 @@
+# Query Jupyter server for defined variables list
+# Tested on 2.7 and 3.6
+from sys import getsizeof
+import json
+
+# who_ls is a Jupyter line magic to fetch currently defined vars
+_VSCode_JupyterVars = %who_ls
+
+print(json.dumps([{'name': var,
+                   'type': type(eval(var)).__name__,
+                   'size': getsizeof(var),
+                   'expensive': True
+                   } for var in _VSCode_JupyterVars]))