Metadata-Version: 2.4
Name: pdit
Version: 0.1.0
Summary: Interactive Python code editor with inline execution results
Author: Harry Vangberg
License: Private
Project-URL: Homepage, https://github.com/vangberg/pdit
Project-URL: Repository, https://github.com/vangberg/pdit
Project-URL: Issues, https://github.com/vangberg/pdit/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: <3.14,>=3.9
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.104.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: typer>=0.9.0
Requires-Dist: aiofiles>=23.0.0
Requires-Dist: watchfiles>=0.20.0
Requires-Dist: jupyter_client>=8.0.0
Requires-Dist: ipykernel>=6.29.0
Requires-Dist: itables>=2.6.1
Requires-Dist: ipython>=8.18.1
Provides-Extra: examples
Requires-Dist: great-tables>=0.20.0; extra == "examples"
Requires-Dist: matplotlib>=3.7.5; extra == "examples"
Requires-Dist: pandas>=2.0.3; extra == "examples"
Requires-Dist: polars>=1.8.2; extra == "examples"

# pdit

Output-focused Python editor.

pdit lets you write regular Python files and see execution results inline, like a notebook but without cells. Edit in your browser or your favorite editor.

## Quick Start

```bash
pip install pdit
pdit script.py
```

## Features

- **Output-focused** - Results appear inline next to the code that generated them
- **Just Python scripts** - No notebooks, no cells, no special format. Work with plain `.py` files
- **File watching** - Changes to the file on disk automatically reload in the editor
- **Auto-run** - Execute code automatically when the file changes
- **Coding agents** - Perfect companion for Claude Code, Cursor, and other AI coding tools that edit files

### Rich Output

- **IPython display** - Rich outputs via [IPython.display](https://ipython.readthedocs.io/en/latest/api/generated/IPython.display.html)
- **Matplotlib** - Inline plot rendering
- **Interactive DataFrames** - Sortable, searchable tables
- **Markdown** - Format text output with Markdown

## Output

### Markdown

Top-level string output renders as Markdown, so headings, lists, and emphasis display cleanly.

### HTML

Rich HTML output is supported for objects that implement `_repr_html_()`; see note: [IPython.display.display](https://ipython.readthedocs.io/en/latest/api/generated/IPython.display.html#IPython.display.display).

### IPython display

IPython display objects render inline; see [IPython.display](https://ipython.readthedocs.io/en/latest/api/generated/IPython.display.html) for details.

### DataFrames

Pandas and Polars DataFrames render as interactive tables automatically.

### Plots

Matplotlib figures display inline. Call `plt.show()`.

## Installation

For development installs or running from source, use [uv](https://github.com/astral-sh/uv).

```bash
# Install from dist branch (recommended, includes pre-built assets)
uv add git+https://github.com/vangberg/pdit@dist

# Or use directly with uvx
uvx --from git+https://github.com/vangberg/pdit@dist pdit script.py

# From cloned repo (for development)
git clone git@github.com:vangberg/pdit.git
cd pdit
uv pip install -e .
uv run pdit script.py
```

## Usage

Start pdit with a Python file:

```bash
pdit script.py
```

This will:
1. Start the local server on port 8888
2. Open your browser automatically
3. Load the script file in the editor

If you're running from source, use:

```bash
uv run pdit script.py
```

### Options

```bash
pdit [OPTIONS] [SCRIPT]

Options:
  --port INTEGER      Port to run server on (default: 8888)
  --host TEXT         Host to bind to (default: 127.0.0.1)
  --no-browser        Don't open browser automatically
  --help              Show help message
```

### Examples

```bash
# Start with script
pdit analysis.py

# Custom port
pdit --port 9000 script.py

# Start without opening browser
pdit --no-browser script.py

# Just start the editor (no script)
pdit
```
## Development

See [DEVELOPMENT.md](DEVELOPMENT.md) for development setup and testing.

## License

Private
