A very specific and practical question!
Indeed, having a consistent naming convention for Jupyter Notebook files (.ipynb) is crucial for organization, collaboration, and version control. Here's a widely adopted and recommended naming convention for your .ipynb files:
Convention:
YYYYMMDD - Descriptive_Name - Version.ipynb
Let's break it down:
YYYYMMDD: Date (in ISO 8601 format)
- Use the date when you started working on the notebook (or the date of the last major update).
- This helps you track the chronology of your work, especially when iterating on projects.
Descriptive_Name:
- A brief, concise, and descriptive name that summarizes the notebook's content or purpose.
- Use underscores (
_) instead of spaces to separate words (e.g., Data_Exploration).
- Avoid abbreviations unless they're widely recognized in your domain.
Version (optional, but recommended):
- A version number (e.g.,
v01, v02, etc.) or a short tag (e.g., draft, final, dev) indicating the notebook's state.
- Increment the version number when you make significant changes, updates, or improvements.
- Use
draft for work-in-progress, final for completed and reviewed notebooks.
Examples:
20230220 - Titanic_Data_Exploration_v01.ipynb
- Date: February 20, 2023
- Descriptive Name: Titanic data exploration
- Version: First version (v01)
20230110 - Sentiment_Analysis_dev.ipynb
- Date: January 10, 2023
- Descriptive Name: Sentiment analysis
- Version: Development stage (dev)
20221201 - Hyperparameter_Tuning_final.ipynb
- Date: December 1, 2022
- Descriptive Name: Hyperparameter tuning
- Version: Final version (final)
Additional tips:
- Keep it concise: Limit the filename to ~50 characters (including the date and extension). This ensures readability and avoids truncation issues on some operating systems.
- Use lowercase: Stick to lowercase letters (except for the date, which is already in a standard format). This avoids case sensitivity conflicts across different file systems.
- Don't include:
- Special characters (
!, @, #, $, etc.)
- Punctuation marks (except underscores)
- Project or team names (unless essential to understanding the notebook's context)
- Consistency is key: Stick to this convention across all your projects and teams. It'll pay off in the long run!
Why this convention?
- Sortability: The date prefix allows notebooks to be sorted chronologically in your file explorer.
- Readability: The descriptive name clearly indicates the notebook's content.
- Version control: The version suffix (or tag) helps track changes and iterations.
- Uniqueness: The combination of date, name, and version minimizes filename conflicts.
Now, go forth and name those .ipynb files like a pro!
If you're working in a team or on a large project, consider documenting this convention in your project's README or style guide, so everyone follows the same best practices. Happy notebook-ing!