Retrieving cell metadata from cell

Hi,
I have a use case wherein i want to save some info about a cell in the metadata of the cell. However, the python code running inside that cell needs to access this metadata, is that possible? We looked at nbformat, but that requires knowing the notebook file and also hard to find the cellID of the current cell. Thanks in advance.

1 Like

I wonder if GitHub - jtpio/ipylab: Control JupyterLab from Python Notebooks with Jupyter Widgets ๐Ÿงช โ˜ข๏ธ ๐Ÿ could be of some help here.I never used it but it sounds like it offers a way to use the TypeScript API of JupyterLab from within Python. As for setting metadata from that API, here is one example use I had recently:

1 Like

Thanks a lot @krassowski , let me take a look.