Skip to main content

A lightweight Jupyter-like notebook interface for Python with local code execution

Project description

๐ŸŽฏ IPyTool v0.3 - Lightweight Jupyter Alternative

A lightweight, browser-based Python notebook tool that looks and works just like Jupyter Notebook. Runs in your local Python environment - no Pyodide, no PyScript.

๐Ÿ“ฆ Installation

Install via pip:

pip install ipytool

๐Ÿš€ Quick Start

Just run:

ipytool

The notebook interface will automatically open in your default browser at http://localhost:5000.


โœจ Key Features

๐Ÿ†• Version 0.3 Updates

  • ๐Ÿ“ Markdown Cells - Full rich text documentation support
  • ๐ŸŽจ Beautiful Rendering - Headings, lists, tables, code blocks
  • โœ๏ธ Double-click Edit - Intuitive markdown editing
  • ๐Ÿ”„ Cell Type Toggle - Easy switch between Code/Markdown

Version 0.2 Features

  • ๐Ÿ”ค Intelligent Autocomplete - VSCode-style code suggestions (Ctrl+Space)
  • โฌ†๏ธโฌ‡๏ธ Cell Reordering - Move cells up/down with arrow buttons
  • โž• Flexible Cell Addition - Insert cells at any position
  • ๐Ÿ“Š Smart DataFrame Display - Automatic HTML table rendering
  • ๐Ÿ“ฆ Package Installation - !pip install support with progress
  • ๐Ÿ’ฌ Interactive Input - Modal-based input() function

๐ŸŽจ Authentic Jupyter Interface

  • Exact Jupyter Notebook design aur color scheme
  • Professional typography aur spacing
  • In [1]: / Out[1]: execution counters
  • Hover-based cell toolbars
  • Smooth animations aur transitions

๐Ÿš€ Powerful Code Execution

  • Stateful execution - Variables persist across cells (Jupyter-like behavior)
  • Full numpy, pandas, aur sabhi installed packages support
  • Real-time output display with proper formatting
  • Error messages with complete tracebacks
  • Execution counter tracking

โŒจ๏ธ Professional Features

  • Code Autocomplete - Python keywords, builtins, aur user-defined suggestions
  • Keyboard shortcuts (Shift+Enter, Ctrl+Enter, Ctrl+Space)
  • Cell management - Reorder, insert, delete
  • Kernel restart capability
  • Notebook save/load with JSON format

๐Ÿ”ง Enterprise-Grade Design

  • Clean, minimal, professional UI
  • Responsive design for all screen sizes
  • Smooth state management
  • Proper error handling
  • Session-based architecture

๐Ÿš€ Quick Start

1. Install Dependencies

# Virtual environment already active
source venv/bin/activate

# Install requirements (already done)
pip install -r requirements.txt

2. Run the Application

python app.py

3. Open Browser

Navigate to: http://localhost:5000


๐Ÿ“– Usage Guide

Basic Operations

Create a New Cell

  • Click โž• button in toolbar
  • Or press B key (when not in edit mode)

Run a Cell

  • Click โ–ถ Run button
  • Or press Shift+Enter (runs and selects next cell)
  • Or press Ctrl+Enter (runs current cell)

Delete a Cell

  • Click ๐Ÿ—‘ button in cell toolbar (appears on hover)

Run All Cells

  • Click โ–ถโ–ถ Run All button in toolbar

Advanced Features

Using input() Function

# This now works perfectly!
name = input("Enter your name: ")
age = input("Enter your age: ")
print(f"Hello {name}, you are {age} years old!")

A modal dialog will appear for each input() call.

Save Notebook

  1. Enter notebook name in top input field
  2. Click ๐Ÿ’พ button
  3. Notebook saved in notebooks/ folder as JSON

Load Notebook

  1. Click ๐Ÿ“‚ Load button
  2. Enter notebook name
  3. Notebook loads with all cells and outputs

Restart Kernel

  1. Click โŸณ Restart button
  2. All variables cleared
  3. New session created

Keyboard Shortcuts

Shortcut Action
Shift+Enter Run cell and select next
Ctrl+Enter Run current cell
Tab Indent code (in cell)
B Insert cell below

๐Ÿงช Testing Examples

Example 1: NumPy & Pandas

# Cell 1
import numpy as np
import pandas as pd

arr = np.arange(10)
df = pd.DataFrame({
    "values": arr,
    "squared": arr ** 2
})
print(df)
# Cell 2 - Variables persist!
total = df["squared"].sum()
print(f"Total: {total}")

Example 2: Interactive Input

# Cell 1
name = input("What's your name? ")
age = int(input("What's your age? "))

print(f"\nHello {name}!")
print(f"In 10 years, you'll be {age + 10} years old.")

Example 3: Data Analysis

# Cell 1
import pandas as pd
import numpy as np

# Create sample data
data = pd.DataFrame({
    'product': ['A', 'B', 'C', 'D'],
    'sales': [100, 150, 200, 175],
    'profit': [20, 35, 50, 40]
})

print(data)
# Cell 2 - Analyze the data
data['profit_margin'] = (data['profit'] / data['sales']) * 100
print("\nWith Profit Margins:")
print(data)

print(f"\nAverage Profit Margin: {data['profit_margin'].mean():.2f}%")

๐Ÿ“ Project Structure

pyide/
โ”œโ”€โ”€ app.py              # Flask backend with session management
โ”œโ”€โ”€ requirements.txt    # Python dependencies
โ”œโ”€โ”€ static/
โ”‚   โ”œโ”€โ”€ index.html     # Jupyter-style UI
โ”‚   โ”œโ”€โ”€ main.js        # Frontend logic with input() support
โ”‚   โ””โ”€โ”€ styles.css     # Professional Jupyter styling
โ”œโ”€โ”€ notebooks/         # Saved notebooks (JSON format)
โ”œโ”€โ”€ venv/             # Python virtual environment
โ””โ”€โ”€ README.md         # This file

๐Ÿ”ง Technical Architecture

Backend (Flask)

  • Session Management: UUID-based sessions with isolated namespaces
  • Code Execution: exec() with proper stdout/stderr capture
  • Input Handling: Interactive input() support with callback mechanism
  • State Persistence: Variables persist across cells within same session
  • Error Handling: Full traceback capture and display

Frontend (Vanilla JS)

  • Cell Management: Dynamic cell creation/deletion with execution counters
  • Input Modal: Beautiful dialog for input() function calls
  • Keyboard Shortcuts: Jupyter-like keyboard navigation
  • Real-time Updates: Async execution with loading states
  • Session Tracking: Maintains connection to backend session

Storage

  • Notebooks saved as JSON in notebooks/ folder
  • Contains: cell code, outputs, execution counts
  • Easy to version control and share

๐ŸŽจ Design Philosophy

Yeh tool enterprise-grade software ki tarah design kiya gaya hai:

  1. โœ… Professional Look - Exact Jupyter Notebook appearance
  2. โœ… Clean Code - Modular, well-commented, maintainable
  3. โœ… User Experience - Smooth interactions, helpful feedback
  4. โœ… Reliability - Proper error handling, state management
  5. โœ… Performance - Efficient rendering, async operations
  6. โœ… Extensibility - Easy to add new features

๐Ÿ› Troubleshooting

Port Already in Use

# Find and kill process on port 5000
lsof -ti:5000 | xargs kill -9

# Or use different port
# Edit app.py: app.run(..., port=5001)

Module Not Found

# Ensure virtual environment is active
source venv/bin/activate

# Reinstall requirements
pip install -r requirements.txt

Session Lost

  • Click โŸณ Restart button to create new session
  • Or refresh the page

๐Ÿš€ Future Enhancements

Possible improvements for even more professional feel:

  • Markdown cells support
  • Rich output (plots, images, HTML)
  • Code syntax highlighting
  • Auto-completion
  • Cell output collapsing
  • Export to .ipynb format
  • Multiple kernel support
  • Real-time collaboration

๐Ÿ“ Notes

  • Security: Yeh tool sirf local use ke liye hai. Production deployment ke liye proper security measures add karein.
  • Python Environment: Same Python environment use hota hai jahan Flask run ho raha hai.
  • Browser Support: Modern browsers (Chrome, Firefox, Edge, Safari) mein best kaam karta hai.

๐Ÿ‘จโ€๐Ÿ’ป Developer Notes

Code quality professional standards follow karta hai:

  • Backend: Clean Flask routes with proper error handling
  • Frontend: Modular JavaScript with clear function separation
  • Styling: Professional CSS with Jupyter-matching design
  • Documentation: Extensive comments and docstrings

๐ŸŽ‰ Enjoy Coding!

Ab aap ek professional Jupyter Notebook experience enjoy kar sakte hain apne local machine par! ๐Ÿš€

Happy Coding! ๐Ÿ’ปโœจ

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

ipytool-1.0.0.tar.gz (67.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipytool-1.0.0-py3-none-any.whl (61.9 kB view details)

Uploaded Python 3

File details

Details for the file ipytool-1.0.0.tar.gz.

File metadata

  • Download URL: ipytool-1.0.0.tar.gz
  • Upload date:
  • Size: 67.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for ipytool-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1f0a0b261ae837e7c6e91baf7221a9c5f17eabaa25877342c86d28e9288c0110
MD5 2b65751fb2d281a6fe7f5ed5943da47c
BLAKE2b-256 f462cfd2e179056dfdffdb7653ab499ab3fb4c601b7c6ce771980df802f54356

See more details on using hashes here.

File details

Details for the file ipytool-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ipytool-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 61.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for ipytool-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d332c7e7229da67ce045e956f808aa395ec8c0d789bd4675ea5132b865a29c7e
MD5 11a987adcd5138a84d3065013e07cc9c
BLAKE2b-256 b7f8caf5c63f2ff54ee8b8dc0320b7ea17294c7f13d120226ccd79fb590ad133

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page