Skip to content

feat: include marimo metadata on ipynb export#7878

Merged
akshayka merged 2 commits intomainfrom
dm/meta
Jan 18, 2026
Merged

feat: include marimo metadata on ipynb export#7878
akshayka merged 2 commits intomainfrom
dm/meta

Conversation

@dmadisetti
Copy link
Collaborator

📝 Summary

When exporting marimo notebooks to .ipynb format, we now include marimo-specific metadata at the notebook level. This enables better round-trip conversion and interoperability.

Export (marimo -> ipynb):

  • metadata.marimo.marimo_version - the marimo version that generated the notebook
  • metadata.marimo.app_config - non-default app configuration (width, sql_output, etc.)
  • metadata.marimo.header - PEP 723 inline script metadata, docstrings
  • metadata.language_info - standard Jupyter language info (without Python version to avoid environment-dependent snapshots)

Import (ipynb -> marimo):

  • Reads metadata.marimo.app_config to restore app configuration
  • Reads metadata.marimo.header to restore PEP 723 metadata
  • Reads cell-level metadata.marimo.config to restore hide_code, column, disabled

Example output

  {                                    
    "metadata": {                      
      "marimo": {                      
        "marimo_version": "0.10.0",    
        "app_config": {                
          "width": "full",             
          "sql_output": "native"       
        },                             
        "header": "# /// script\n# dependencies = [\"pandas\"]\n# ///"        
      },                               
      "language_info": {               
        "name": "python",              
        "codemirror_mode": {"name": "ipython", "version": 3},                 
        // ...
      }                                
    }                                  
  }                                    

Spec compliance

The Jupyter nbformat schema explicitly allows custom metadata via "additionalProperties": true on the metadata object. Using a tool-specific namespace key is the canonical approach, as seen with other tools:

  • Google Colab: metadata.colab
  • ipypublish: metadata.ipub
  • Pretty Jupyter: metadata.pj_metadata

Reference: https://nbformat.readthedocs.io/en/latest/format_description.html

@vercel
Copy link

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jan 16, 2026 10:01pm

Request Review

@dmadisetti dmadisetti added the enhancement New feature or request label Jan 16, 2026
@akshayka akshayka merged commit a0f0b41 into main Jan 18, 2026
39 of 45 checks passed
@akshayka akshayka deleted the dm/meta branch January 18, 2026 03:48
@github-actions
Copy link

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.5-dev12

botterYosuke pushed a commit to botterYosuke/marimo that referenced this pull request Jan 18, 2026
## 📝 Summary

When exporting marimo notebooks to .ipynb format, we now include
marimo-specific metadata at the notebook level. This enables better
round-trip conversion and interoperability.

Export (marimo -> ipynb):
- `metadata.marimo.marimo_version` - the marimo version that generated
the notebook
- `metadata.marimo.app_config` - non-default app configuration (width,
sql_output, etc.)
- `metadata.marimo.header` - PEP 723 inline script metadata, docstrings
- `metadata.language_info` - standard Jupyter language info (without
Python version to avoid environment-dependent snapshots)

Import (ipynb -> marimo):
- Reads m`etadata.marimo.app_config` to restore app configuration
- Reads `metadata.marimo.header` to restore PEP 723 metadata
- Reads cell-level `metadata.marimo.config` to restore hide_code,
column, disabled

### Example output

```json
  {                                    
    "metadata": {                      
      "marimo": {                      
        "marimo_version": "0.10.0",    
        "app_config": {                
          "width": "full",             
          "sql_output": "native"       
        },                             
        "header": "# /// script\n# dependencies = [\"pandas\"]\n# ///"        
      },                               
      "language_info": {               
        "name": "python",              
        "codemirror_mode": {"name": "ipython", "version": 3},                 
        // ...
      }                                
    }                                  
  }                                    
```

## Spec compliance

The Jupyter nbformat schema explicitly allows custom metadata via
`"additionalProperties": true` on the metadata object. Using a
tool-specific namespace key is the canonical approach, as seen with
other tools:

  - Google Colab: metadata.colab
  - ipypublish: metadata.ipub
  - Pretty Jupyter: metadata.pj_metadata

Reference:
https://nbformat.readthedocs.io/en/latest/format_description.html

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
mscolnick pushed a commit that referenced this pull request Jan 19, 2026
## 📝 Summary

When exporting marimo notebooks to .ipynb format, we now include
marimo-specific metadata at the notebook level. This enables better
round-trip conversion and interoperability.

Export (marimo -> ipynb):
- `metadata.marimo.marimo_version` - the marimo version that generated
the notebook
- `metadata.marimo.app_config` - non-default app configuration (width,
sql_output, etc.)
- `metadata.marimo.header` - PEP 723 inline script metadata, docstrings
- `metadata.language_info` - standard Jupyter language info (without
Python version to avoid environment-dependent snapshots)

Import (ipynb -> marimo):
- Reads m`etadata.marimo.app_config` to restore app configuration
- Reads `metadata.marimo.header` to restore PEP 723 metadata
- Reads cell-level `metadata.marimo.config` to restore hide_code,
column, disabled

### Example output

```json
  {                                    
    "metadata": {                      
      "marimo": {                      
        "marimo_version": "0.10.0",    
        "app_config": {                
          "width": "full",             
          "sql_output": "native"       
        },                             
        "header": "# /// script\n# dependencies = [\"pandas\"]\n# ///"        
      },                               
      "language_info": {               
        "name": "python",              
        "codemirror_mode": {"name": "ipython", "version": 3},                 
        // ...
      }                                
    }                                  
  }                                    
```

## Spec compliance

The Jupyter nbformat schema explicitly allows custom metadata via
`"additionalProperties": true` on the metadata object. Using a
tool-specific namespace key is the canonical approach, as seen with
other tools:

  - Google Colab: metadata.colab
  - ipypublish: metadata.ipub
  - Pretty Jupyter: metadata.pj_metadata

Reference:
https://nbformat.readthedocs.io/en/latest/format_description.html

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants