Skip to content

rallm/ipynb2txt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ipynb2txt

A lightweight Command Line Interface (CLI) tool for Linux/Ubuntu to convert Jupyter Notebook files (.ipynb) into plain text files (.txt). The tool extracts only the source code and markdown content cell by cell, intentionally ignoring cell outputs.

This tool can be executed using either the ipynb2txt or notebook2txt commands.

Features

  • Zero dependencies: Built using strictly Python standard libraries.
  • Clean extraction: Ignores execution outputs and metadata, keeping only the actual code and markdown.
  • Dual command access: Available system-wide as both ipynb2txt and notebook2txt.
  • Custom output routing: Generates a text file with the same name automatically, or allows specifying a custom output path.

Installation

You can install this tool system-wide by cloning the repository and copying the executable to your local binaries directory.

  1. Clone the repository
git clone https://github.com/rallm/ipynb2txt.git
cd ipynb2txt
  1. Make the script executable:
chmod +x ipynb2txt
  1. Copy the script to your system binaries directory using cp:
sudo cp ipynb2txt /usr/local/bin/ipynb2txt
  1. Create a symbolic link to make the tool available as notebook2txt as well (optional):
sudo ln -s /usr/local/bin/ipynb2txt /usr/local/bin/notebook2txt

Usage

You can use either ipynb2txt or notebook2txt. The behavior is identical.

Default Conversion

Converts the notebook and creates a text file with the same name in the current directory:

ipynb2txt my_notebook.ipynb

(Produces: my_notebook.txt)

Custom Output Path

Use the -o or --output flag to specify an exact destination and file name:

notebook2txt my_notebook.ipynb -o /path/to/destination/custom_name.txt

Help Manual

To view the help manual and available arguments:

ipynb2txt --help

License

This project is licensed under the MIT License.

About

a simple tool for llm usage, easy converter for jupyter notebooks to txt files, ubuntu usage

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages