nbcat 0.9.2__py3-none-any.whl → 0.9.3__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 CHANGED
@@ -1 +1 @@
1
- __version__ = "0.9.2"
1
+ __version__ = "0.9.3"
nbcat/main.py CHANGED
@@ -26,7 +26,7 @@ from .schemas import Cell, Notebook
26
26
  console = Console()
27
27
 
28
28
 
29
- def read_notebook(fp: str) -> Notebook:
29
+ def read_notebook(fp: str, debug: bool = False) -> Notebook:
30
30
  """
31
31
  Load and parse a Jupyter notebook from a local file or remote URL.
32
32
 
@@ -61,6 +61,8 @@ def read_notebook(fp: str) -> Notebook:
61
61
  try:
62
62
  return Notebook.model_validate_json(content)
63
63
  except ValidationError as e:
64
+ if not debug:
65
+ raise InvalidNotebookFormatError("Failed to read notebook")
64
66
  raise InvalidNotebookFormatError(f"Invalid notebook: {e}")
65
67
 
66
68
 
@@ -156,11 +158,14 @@ def main():
156
158
  action="version",
157
159
  version=__version__,
158
160
  )
161
+ parser.add_argument(
162
+ "--debug", help="enable extended error output", action="store_true", default=False
163
+ )
159
164
 
160
165
  try:
161
166
  argcomplete.autocomplete(parser)
162
167
  args = parser.parse_args()
163
- notebook = read_notebook(args.file)
168
+ notebook = read_notebook(args.file, debug=args.debug)
164
169
  print_notebook(notebook)
165
170
  except Exception as e:
166
171
  sys.exit(f"nbcat: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbcat
3
- Version: 0.9.2
3
+ Version: 0.9.3
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
@@ -0,0 +1,11 @@
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,,
@@ -1,11 +0,0 @@
1
- nbcat/__init__.py,sha256=gqT-BGoeEItda9fICQDvLbxEjWRIBhFJxPxxKvmHLUo,22
2
- nbcat/enums.py,sha256=ZsuOwYLF0D4PVwSkS74LwoXY0y0DkeBToLBWnmiS97Y,300
3
- nbcat/exceptions.py,sha256=Ho7LQz9K70VtIMDNtAwuAtGmb-lFKxGxSj7MN3-EpDA,321
4
- nbcat/main.py,sha256=Cv5CLuibhuEvLFxKH3vIk7XsD_Zr2ecTKACW1hy7d8c,4981
5
- nbcat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- nbcat/schemas.py,sha256=IK1l2a4UcP6Ivh8xRBzV5BIQTbeES1b1cCH-6goEq8Q,2366
7
- nbcat-0.9.2.dist-info/METADATA,sha256=FaJtGOMbBL_K2JrDY_sRA-r1nxdQeZysezxVny9X0rU,3376
8
- nbcat-0.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- nbcat-0.9.2.dist-info/entry_points.txt,sha256=io_GRDsecAkYuCZALsjyea3VBq91VCoSznqlZEAJshY,42
10
- nbcat-0.9.2.dist-info/licenses/LICENSE,sha256=7GjUnahXdd5opdvlpJdb1BisLbiXt2iOFhzIUduhdkE,1072
11
- nbcat-0.9.2.dist-info/RECORD,,
File without changes