EMR Notebooks Magics

0.2.4 · active · verified Sat Apr 11

EMR Notebooks Magics is a Python library providing Jupyter magics specifically for Amazon EMR Notebooks. These magics enhance the interactive experience by allowing direct interaction with EMR cluster resources, such as mounting S3 workspaces and executing other notebooks. The library is currently at version 0.2.4 and is actively maintained by AWS Labs, with updates tied to EMR Notebooks and EMR Studio feature development.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates the core functionalities of EMR Notebooks Magics: mounting a workspace directory, generating a presigned S3 download URL, and executing another notebook. These commands are run directly in a Jupyter cell within an EMR Notebook environment.

# After installing the package and restarting the kernel in an EMR Notebook.

# Mount the entire Workspace directory to the EMR cluster instance
%mount_workspace_dir .

# Generate a presigned URL for an S3 object
# Replace with your actual S3 bucket and object key
%generate_s3_download_url s3://my-example-bucket/path/to/my-file.csv

# Execute another notebook in the background
# Make sure 'another_notebook.ipynb' exists in your workspace
%execute_notebook another_notebook.ipynb

view raw JSON →