A tool to convert .py files to .ipynb
Project description
py2nb
A tool to convert .py
files to .ipynb
files and delete the original .py
files. This tool makes it easy to convert Python scripts into Jupyter Notebooks for easy sharing and collaboration.
Project Insights
py2nb
is designed to streamline the process of converting Python scripts into Jupyter Notebooks. It is particularly useful for educators, data scientists, and developers who need to present their Python code in a more interactive format.
Features
- Converts
.py
files to.ipynb
files - Deletes the original
.py
files after conversion - Processes directories to batch convert multiple files
- Simple command-line interface for ease of use
How to Start with Source Code
To start using py2nb
, follow these steps:
-
Clone the Repository
git clone https://github.com/w3cdpass/notebook-ed.git cd py2nb
-
Create a Virtual Environment
python -m venv py2nb_env
-
Activate the Virtual Environment
- On Windows:
py2nb_env\Scripts\activate
- On macOS/Linux:
source py2nb_env/bin/activate
- On Windows:
-
Install Dependencies
pip install -r requirements.txt
-
Run the Script
python -m py2nb -r <root_directory> # To convert all .py files in a directory python -m py2nb -f <file_path> # To convert a single .py file
How to Contribute
We welcome contributions to py2nb
! If you have ideas for improvements or have found bugs, please follow these steps to contribute:
-
Fork the Repository
Click the "Fork" button at the top right corner of this repository page.
-
Clone Your Fork
git clone https://github.com/w3cdpass/notebook-ed.git cd py2nb
-
Create a New Branch
git checkout -b your-branch-name
-
Make Your Changes
Make your changes to the codebase and ensure that all tests pass.
-
Commit Your Changes
git add . git commit -m "Description of your changes"
-
Push to Your Fork
git push origin your-branch-name
-
Create a Pull Request
Go to the original repository and create a pull request with a description of your changes.# notebook-ed
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for notebook_ed-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dec62e6e370f448742786ebd8b33021c92194bd06c002103fdfbcc82dada6ce4 |
|
MD5 | 74ebec8025b2c6ee10b8732540217712 |
|
BLAKE2b-256 | b4a94a3ffc8dba0ba3a16587d3a90c75b4b280319e730a1bbfe8ab16bbf93a5e |