pipescript 0.0.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pipescript/__init__.py +47 -0
- pipescript/_version.py +658 -0
- pipescript/api.py +85 -0
- pipescript/completion_patch.py +30 -0
- pipescript/constants.py +3 -0
- pipescript/extract_names.py +60 -0
- pipescript/macro_tracer.py +247 -0
- pipescript/pipeline_tracer.py +793 -0
- pipescript/placeholders.py +177 -0
- pipescript/traceback_patch.py +39 -0
- pipescript/utils.py +15 -0
- pipescript/version.py +23 -0
- pipescript-0.0.1.dist-info/METADATA +256 -0
- pipescript-0.0.1.dist-info/RECORD +17 -0
- pipescript-0.0.1.dist-info/WHEEL +6 -0
- pipescript-0.0.1.dist-info/licenses/docs/LICENSE.txt +11 -0
- pipescript-0.0.1.dist-info/top_level.txt +1 -0
pipescript/__init__.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""
|
|
2
|
+
pipescript: powerful pipeline syntax for IPython and Jupyter.
|
|
3
|
+
Just run `%load_ext pipescript` to begin using pipe operators, placeholders, and more.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from IPython.core.interactiveshell import InteractiveShell
|
|
9
|
+
|
|
10
|
+
from . import _version # noqa: E402
|
|
11
|
+
from .completion_patch import patch_completer, unpatch_completer
|
|
12
|
+
|
|
13
|
+
__version__ = _version.get_versions()["version"]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def load_ipython_extension(shell: InteractiveShell) -> None:
|
|
17
|
+
from ipyflow.shell.interactiveshell import IPyflowInteractiveShell
|
|
18
|
+
|
|
19
|
+
from pipescript.macro_tracer import MacroTracer
|
|
20
|
+
from pipescript.pipeline_tracer import PipelineTracer
|
|
21
|
+
|
|
22
|
+
if not isinstance(shell, IPyflowInteractiveShell):
|
|
23
|
+
shell.run_line_magic("load_ext", "ipyflow.shell")
|
|
24
|
+
shell.run_line_magic("flow", "deregister all")
|
|
25
|
+
assert isinstance(shell, IPyflowInteractiveShell)
|
|
26
|
+
shell.run_line_magic(
|
|
27
|
+
"flow", f"register {PipelineTracer.__module__}.{PipelineTracer.__name__}"
|
|
28
|
+
)
|
|
29
|
+
shell.run_line_magic(
|
|
30
|
+
"flow",
|
|
31
|
+
f"register {MacroTracer.__module__}.{MacroTracer.__name__}",
|
|
32
|
+
)
|
|
33
|
+
patch_completer(shell.Completer)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def unload_ipython_extension(shell: InteractiveShell) -> None:
|
|
37
|
+
from pipescript.macro_tracer import MacroTracer
|
|
38
|
+
from pipescript.pipeline_tracer import PipelineTracer
|
|
39
|
+
|
|
40
|
+
unpatch_completer(shell.Completer)
|
|
41
|
+
shell.run_line_magic(
|
|
42
|
+
"flow",
|
|
43
|
+
f"deregister {MacroTracer.__module__}.{MacroTracer.__name__}",
|
|
44
|
+
)
|
|
45
|
+
shell.run_line_magic(
|
|
46
|
+
"flow", f"deregister {PipelineTracer.__module__}.{PipelineTracer.__name__}"
|
|
47
|
+
)
|