nbcat 0.9.3__py3-none-any.whl → 0.9.4__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.
- nbcat/__init__.py +1 -1
- nbcat/main.py +3 -2
- nbcat/schemas.py +7 -7
- {nbcat-0.9.3.dist-info → nbcat-0.9.4.dist-info}/METADATA +2 -2
- nbcat-0.9.4.dist-info/RECORD +11 -0
- nbcat-0.9.3.dist-info/RECORD +0 -11
- {nbcat-0.9.3.dist-info → nbcat-0.9.4.dist-info}/WHEEL +0 -0
- {nbcat-0.9.3.dist-info → nbcat-0.9.4.dist-info}/entry_points.txt +0 -0
- {nbcat-0.9.3.dist-info → nbcat-0.9.4.dist-info}/licenses/LICENSE +0 -0
nbcat/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.9.
|
1
|
+
__version__ = "0.9.4"
|
nbcat/main.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import argparse
|
2
2
|
import sys
|
3
3
|
from pathlib import Path
|
4
|
+
from typing import Union
|
4
5
|
|
5
6
|
import argcomplete
|
6
7
|
import requests
|
@@ -66,7 +67,7 @@ def read_notebook(fp: str, debug: bool = False) -> Notebook:
|
|
66
67
|
raise InvalidNotebookFormatError(f"Invalid notebook: {e}")
|
67
68
|
|
68
69
|
|
69
|
-
def render_cell(cell: Cell) -> list[tuple[str
|
70
|
+
def render_cell(cell: Cell) -> list[tuple[Union[str, None], RenderableType]]:
|
70
71
|
"""
|
71
72
|
Render the content of a notebook cell for display.
|
72
73
|
|
@@ -98,7 +99,7 @@ def render_cell(cell: Cell) -> list[tuple[str | None, RenderableType]]:
|
|
98
99
|
CellType.HEADING: _render_markdown,
|
99
100
|
}
|
100
101
|
|
101
|
-
rows: list[tuple[str
|
102
|
+
rows: list[tuple[Union[str, None], RenderableType]] = []
|
102
103
|
renderer = RENDERERS.get(cell.cell_type)
|
103
104
|
source = renderer(cell.input) if renderer else None
|
104
105
|
if source:
|
nbcat/schemas.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any
|
1
|
+
from typing import Any, Union
|
2
2
|
|
3
3
|
from pydantic import BaseModel, computed_field, model_validator
|
4
4
|
|
@@ -8,11 +8,11 @@ from .exceptions import InvalidNotebookFormatError
|
|
8
8
|
|
9
9
|
class BaseOutput(BaseModel):
|
10
10
|
output_type: OutputType
|
11
|
-
execution_count: int
|
11
|
+
execution_count: Union[int, None] = None
|
12
12
|
|
13
13
|
|
14
14
|
class StreamOutput(BaseOutput):
|
15
|
-
text: list[str]
|
15
|
+
text: Union[list[str], str]
|
16
16
|
|
17
17
|
@computed_field
|
18
18
|
@property
|
@@ -54,10 +54,10 @@ class PyoutDataOutput(BaseOutput):
|
|
54
54
|
|
55
55
|
class Cell(BaseModel):
|
56
56
|
cell_type: CellType
|
57
|
-
source: list[str]
|
58
|
-
level: int
|
59
|
-
execution_count: int
|
60
|
-
outputs: list[StreamOutput
|
57
|
+
source: Union[list[str], str]
|
58
|
+
level: Union[int, None] = None
|
59
|
+
execution_count: Union[int, None] = None
|
60
|
+
outputs: list[Union[StreamOutput, DisplayDataOutput, ErrorOutput, PyoutDataOutput]] = []
|
61
61
|
|
62
62
|
@model_validator(mode="before")
|
63
63
|
@classmethod
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: nbcat
|
3
|
-
Version: 0.9.
|
3
|
+
Version: 0.9.4
|
4
4
|
Summary: cat for jupyter notebooks
|
5
5
|
Project-URL: Homepage, https://github.com/akopdev/nbcat
|
6
6
|
Project-URL: Repository, https://github.com/akopdev/nbcat
|
@@ -28,7 +28,7 @@ License: MIT License
|
|
28
28
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
29
29
|
SOFTWARE.
|
30
30
|
License-File: LICENSE
|
31
|
-
Requires-Python: >=3.
|
31
|
+
Requires-Python: >=3.9
|
32
32
|
Requires-Dist: argcomplete
|
33
33
|
Requires-Dist: pydantic
|
34
34
|
Requires-Dist: requests
|
@@ -0,0 +1,11 @@
|
|
1
|
+
nbcat/__init__.py,sha256=e56AvHfJCtG2ZwwINqsxINVbehWdKxMYgIDbjd7P-II,22
|
2
|
+
nbcat/enums.py,sha256=ZsuOwYLF0D4PVwSkS74LwoXY0y0DkeBToLBWnmiS97Y,300
|
3
|
+
nbcat/exceptions.py,sha256=Ho7LQz9K70VtIMDNtAwuAtGmb-lFKxGxSj7MN3-EpDA,321
|
4
|
+
nbcat/main.py,sha256=02qOCh4I4kXpoIgZCRYztiY5QPDw7FkAbC4smjl1Sxc,5273
|
5
|
+
nbcat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
nbcat/schemas.py,sha256=miVL0GDHIqXaFxz_cd9qn7cSZvIjZYK8TTY9YsfkuXs,2407
|
7
|
+
nbcat-0.9.4.dist-info/METADATA,sha256=VkAsyObzS8n5gT7qzA7Gxertoz863ZWENfqgaz3EGu0,3375
|
8
|
+
nbcat-0.9.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
nbcat-0.9.4.dist-info/entry_points.txt,sha256=io_GRDsecAkYuCZALsjyea3VBq91VCoSznqlZEAJshY,42
|
10
|
+
nbcat-0.9.4.dist-info/licenses/LICENSE,sha256=7GjUnahXdd5opdvlpJdb1BisLbiXt2iOFhzIUduhdkE,1072
|
11
|
+
nbcat-0.9.4.dist-info/RECORD,,
|
nbcat-0.9.3.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
nbcat/__init__.py,sha256=xKd3pzbczuMsdB08eLAOqZDUd_q1IRxwZ_ccAFL4c4A,22
|
2
|
-
nbcat/enums.py,sha256=ZsuOwYLF0D4PVwSkS74LwoXY0y0DkeBToLBWnmiS97Y,300
|
3
|
-
nbcat/exceptions.py,sha256=Ho7LQz9K70VtIMDNtAwuAtGmb-lFKxGxSj7MN3-EpDA,321
|
4
|
-
nbcat/main.py,sha256=X1UbLxXF9Y9V4Z8vE_pUz5cG22zx2oBMMlvpJVWITD0,5236
|
5
|
-
nbcat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
nbcat/schemas.py,sha256=IK1l2a4UcP6Ivh8xRBzV5BIQTbeES1b1cCH-6goEq8Q,2366
|
7
|
-
nbcat-0.9.3.dist-info/METADATA,sha256=IQV8OPxQ0sQFu1BdLK9g6z5-nSv4j36rUhaMJYv0FQ0,3376
|
8
|
-
nbcat-0.9.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
-
nbcat-0.9.3.dist-info/entry_points.txt,sha256=io_GRDsecAkYuCZALsjyea3VBq91VCoSznqlZEAJshY,42
|
10
|
-
nbcat-0.9.3.dist-info/licenses/LICENSE,sha256=7GjUnahXdd5opdvlpJdb1BisLbiXt2iOFhzIUduhdkE,1072
|
11
|
-
nbcat-0.9.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|