Add tuple of cell types to nbformat API
- Dominant language
- Python
- Stars
- 313
- Forks
- 176
- PR merge metrics
- No merged PRs in 30d
Description
When using `nbformat` as a library to process Jupyter notebooks, it would be convenient to have a tuple (or list, or set) of allowed cell types. For instance,
```python
CELL_TYPES = ('markdown', 'code', 'raw', )
```
It would also be useful to have some other similar constants on the API, such as
```python
OPTIONAL_CELL_FIELDS = {
'markdown': {"attachments"},
'code': set(),
'raw': {"attachments"}
}
OPTIONAL_OUTPUT_TYPES = {
'execute_result': {'data', 'metadata' ,'execution_count'},
'stream': {'name', 'text'},
'display_data': {'data', 'metadata', },
'error': {'ename', 'evalue', 'traceback'},
}
```
Contributor guide
Research direction
Start at nbformat's public API entry point and review how cell and output types are currently represented. Add public constants for allowed cell types and the proposed optional cell fields and output types, then verify they are accessible through the library API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100