Hey Anaconda Community!
We’re excited to announce the release of Code Snippets, a powerful new feature that lets you save, organize, and reuse your most valuable code blocks across all your Jupyter notebooks. No more digging through old notebooks or rewriting the same code patterns – your favorite code is now just one click away.
Need to share that killer python function with a colleague? Don’t Slack it to them, just add it to a Code Snippet!
Check out our example notebook here:
What is Code Snippets?
Code Snippets is a built-in sidebar extension for Anaconda Notebooks that allows you to:
- Save any code cell as a reusable snippet
- Search through your snippet library
- Insert snippets into any notebook with one click
Key Features
- Select any cell, or highlight a specific line of code, then hit the Code Snippets icon to save
- One-click insertion into notebooks
- Edit and version tracking, just double click to view the .py file.
- Powerful search functionality
- Share snippets with your team
Getting Started
-
Go to Anaconda Cloud Notebooks. You’ll need an Anaconda account first.
-
Open any Jupyter Notebook and find a cell that you want to save.
-
Save your first snippet by hitting the Code Snippets icon. Give it a descriptive name so that you can find it easily later!
-
Hit the Play icon to insert the Code Snippet into your notebook.
Real-World Use Cases
Data Scientists
- Store common preprocessing steps
- Save visualization templates
- Keep model evaluation metrics handy
- Maintain consistent data cleaning patterns
Researchers
- Reuse experiment setups
- Store common statistical tests
- Keep plotting configurations
- Maintain methodology templates
Teams
- Share best practices
- Maintain coding standards
- Store styled Markdown cells to make your Notebooks clean, but colorful
- Distribute common utilities
- Collaborate on code patterns
Documentation & Resources
Share Your Feedback!
We built Code Snippets based on your feedback, and we want to keep improving it for you. Try it out and let us know:
- What are your favorite use cases?
- What features would you like to see?
- How can we make it even better?
Installation Notes
- This feature is currently only available on Anaconda Cloud Notebooks, but we’ll be rolling it out to Anaconda Navigator users via the Anaconda Toolbox in the New Year so follow this thread for updates!
Happy coding!
- The Anaconda Team