Skip to main content
A Notebook wraps an .ipynb file or Python script so it can be stored and shared through Expected Parrot. Reading or uploading a notebook does not execute its cells or verify its findings. Save the study objects and completed data separately with Saving objects.

Read a saved file

Replace the path with a saved file. For a Python script, use Notebook.from_script("study.py"). For Colab, first download the notebook. For an object constructed from a notebook path, notebook.reload() rereads the saved file after edits. notebook.has_outputs() reports whether any code cells contain outputs. Notebook.from_current_script() wraps the currently executing Python script; use it from a script file rather than a notebook cell. To construct an object directly from notebook-format data:
The example above contains only a Markdown cell and requires no credentials. Construction may format Python code when linting is enabled; inspect the resulting notebook before sharing.

Upload and retrieve

Review code, outputs, and embedded data before uploading. With Expected Parrot authentication configured:
Use the returned identifier to retrieve that object, subject to its access permissions:
These operations contact Expected Parrot; to_file() writes the downloaded notebook locally. For sharing permissions and metadata updates, use Expected Parrot objects and the CLI Guide.