Metadata-Version: 2.4
Name: jupyter_projspec
Version: 0.1.0
Summary: A Jupyter interface for projspec
Project-URL: Homepage, https://github.com/fsspec/jupyter-projspec
Project-URL: Bug Tracker, https://github.com/fsspec/jupyter-projspec/issues
Project-URL: Repository, https://github.com/fsspec/jupyter-projspec.git
Author-email: fsspec Contributors <ktaletskiy@anaconda.com>
License: BSD 3-Clause License
        
        Copyright (c) 2026, fsspec Contributors
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENSE
Keywords: jupyter,jupyterlab,jupyterlab-extension
Classifier: Framework :: Jupyter
Classifier: Framework :: Jupyter :: JupyterLab
Classifier: Framework :: Jupyter :: JupyterLab :: 4
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Requires-Dist: jupyter-server<3,>=2.4.0
Requires-Dist: projspec<0.3,>=0.2.0
Provides-Extra: dev
Requires-Dist: jupyterlab>=4; extra == 'dev'
Provides-Extra: test
Requires-Dist: coverage; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-asyncio; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-jupyter[server]>=0.6.0; extra == 'test'
Description-Content-Type: text/markdown

# jupyter-projspec <img width="32" alt="logo" src="https://github.com/user-attachments/assets/c87219a0-63d1-4f69-ba29-f5b35f1835ee" />

[![Github Actions Status](https://github.com/fsspec/jupyter-projspec/workflows/Build/badge.svg)](https://github.com/fsspec/jupyter-projspec/actions/workflows/build.yml)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/fsspec/jupyter-projspec/main?urlpath=lab)

A JupyterLab extension that brings [projspec](https://github.com/fsspec/projspec) project introspection directly into your development workflow. See at a glance what kind of project you're working in and explore its structure, metadata, and buildable artifacts.

<img width="2517" height="1293" alt="Screenshot 2026-01-09 at 3 59 41 PM" src="https://github.com/user-attachments/assets/cde02dcd-9aa6-4288-a4c7-72c0f82764b0" />

## Features

### 🏷️ Project Type Chips in File Browser

Colored badge chips appear below the breadcrumbs in the file browser, showing all detected project types for the current directory:

- **Instant recognition** — See `🐍 Python Library`, `🔮 Pixi`, `🔀 Git Repository`, etc. at a glance
- **Click to explore** — Clicking a chip opens the sidebar panel and scrolls to that spec's details
- **Unobtrusive** — Chips only appear when project specs are detected; completely hidden otherwise

### 📋 Project Spec Sidebar Panel

A dedicated right sidebar panel provides detailed project information:

- **Synced with file browser** — Automatically updates as you navigate directories
- **Expandable spec items** — Click to reveal contents and artifacts for each project type
- **Contents** — View metadata, dependencies, environment specs, and more
- **Artifacts** — See buildable outputs like wheels, conda packages, documentation

### 🎨 Supported Project Types

jupyter-projspec recognizes many project types through projspec:

| Category            | Types                                                                              |
| ------------------- | ---------------------------------------------------------------------------------- |
| **Version Control** | Git Repository                                                                     |
| **Python**          | Python Library, Poetry, uv, Pixi, Conda Project, Conda Recipe, PyScript, Briefcase |
| **JavaScript**      | Node.js, Yarn, JupyterLab Extension                                                |
| **Rust**            | Rust Crate                                                                         |
| **Documentation**   | mdBook, Read the Docs                                                              |
| **Data & ML**       | Data Package, Hugging Face Repo                                                    |
| **IDEs**            | VS Code, JetBrains IDE, Zed, NVIDIA AI Workbench                                   |

## Requirements

- JupyterLab >= 4.0.0
- Python >= 3.10
- [projspec](https://github.com/fsspec/projspec)

## Install

```bash
pip install jupyter-projspec
```

## Usage

1. **Open JupyterLab** and navigate to any project directory using the file browser
2. **Look for chips** below the breadcrumbs — they appear when projspec detects project types
3. **Click a chip** or the sidebar icon to open the Project Spec panel
4. **Expand specs** to explore contents (metadata, dependencies) and artifacts (buildable outputs)

## Uninstall

```bash
pip uninstall jupyter-projspec
```

## Troubleshoot

If you see the frontend extension but it's not working, verify the server extension is enabled:

```bash
jupyter server extension list
```

If the server extension is installed and enabled but you don't see the frontend extension:

```bash
jupyter labextension list
```

## Contributing

### Development Install

You will need NodeJS to build the extension package.

```bash
# Clone the repo
git clone https://github.com/fsspec/jupyter-projspec.git
cd jupyter-projspec

# Set up a virtual environment
python -m venv .venv
source .venv/bin/activate

# Install in development mode
pip install --editable ".[dev,test]"

# Link your development version with JupyterLab
jupyter labextension develop . --overwrite
jupyter server extension enable jupyter_projspec

# Build the extension (do this after each TypeScript change)
jlpm build
```

### Development Workflow

**Watch mode** (recommended for active development):

```bash
# Terminal 1: Auto-rebuild on file changes
jlpm watch

# Terminal 2: Run JupyterLab
jupyter lab
```

With watch mode running, saved TypeScript changes rebuild automatically. Refresh your browser to see changes.

**After editing Python** (files in `jupyter_projspec/`):

- Restart the JupyterLab server (no rebuild needed)

### Development Uninstall

```bash
jupyter server extension disable jupyter_projspec
pip uninstall jupyter_projspec
```

Remove the symlink created by `jupyter labextension develop`:

```bash
jupyter labextension list  # Find labextensions folder location
# Remove the jupyter-projspec symlink from that folder
```

### Testing

**Server tests** (Python):

```bash
pip install -e ".[test]"
pytest -vv -r ap --cov jupyter_projspec
```

**Frontend tests** (TypeScript):

```bash
jlpm test
```

**Integration tests** (Playwright):

See [ui-tests/README.md](./ui-tests/README.md) for details.

## Architecture

```
jupyter-projspec/
├── src/                          # TypeScript frontend
│   ├── index.ts                  # Extension entry point
│   ├── components/               # React components
│   │   ├── ProjspecPanelComponent.tsx
│   │   ├── ProjectView.tsx
│   │   ├── SpecItem.tsx
│   │   ├── ContentsView.tsx
│   │   ├── ArtifactsView.tsx
│   │   └── ProjspecChips.tsx     # File browser chips
│   └── widgets/
│       ├── ProjspecPanel.ts      # Sidebar panel widget
│       └── ProjspecChipsWidget.ts
├── jupyter_projspec/             # Python backend
│   ├── __init__.py               # Server extension setup
│   └── routes.py                 # API route handlers
├── style/                        # CSS styles
└── schema/                       # JupyterLab settings schema
```

### API Endpoints

| Endpoint                 | Method | Description                               |
| ------------------------ | ------ | ----------------------------------------- |
| `/jupyter-projspec/scan` | GET    | Scan a directory and return projspec data |

## Roadmap

Future enhancements being considered:

- [ ] **MAKE buttons** — Execute artifact builds directly from the UI
- [ ] **Build output display** — Show stdout/stderr from artifact builds
- [ ] **File browser navigation** — Click built artifacts to reveal them
- [ ] **Real-time streaming** — Live output for long-running builds
- [ ] **jupyter-fsspec integration** — Support for remote filesystems

## AI Coding Assistant Support

This project includes an `AGENTS.md` file with coding standards for JupyterLab extension development. Compatible with AI assistants that support the [AGENTS.md standard](https://agents.md).

## License

BSD-3-Clause

## Acknowledgments

Built on [projspec](https://github.com/fsspec/projspec) by the fsspec team.
