Metadata-Version: 2.4
Name: pphs
Version: 1.0.1
Summary: A polished developer-friendly static file server with a searchable file browser and code viewer.
Author: PPHS Contributors
License: MIT
Project-URL: Homepage, https://github.com/elias-ebrahimpour/pphs
Project-URL: Repository, https://github.com/elias-ebrahimpour/pphs
Project-URL: Issues, https://github.com/elias-ebrahimpour/pphs/issues
Keywords: http,server,static,fileserver,developer-tools,cli,directory-browser
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer<1.0,>=0.12
Requires-Dist: Pygments>=2.17
Requires-Dist: qrcode<8,>=7.4
Provides-Extra: markdown
Requires-Dist: Markdown>=3.6; extra == "markdown"
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Provides-Extra: all
Requires-Dist: Markdown>=3.6; extra == "all"
Dynamic: license-file

# pphs (Python Pretty Http Server)

A polished, developer-friendly alternative to `python -m http.server`.

## Features

- Python 3.10+
- Typer CLI
- `ThreadingHTTPServer` + `SimpleHTTPRequestHandler`
- Live filename search and file-type filter
- Click-to-sort columns (name, size, modified date)
- **Drag & drop file upload** straight from the browser (or use the Browse button)
- **QR code in the terminal** for one-tap access from your phone on the same Wi-Fi
- **Light/dark theme toggle**, remembered per browser
- **Breadcrumb navigation** for the current path
- Folder/file counts and total size shown per directory
- **View** and **Download** buttons
- Built-in source viewer with line numbers
- Pygments syntax highlighting
- Markdown rendering with the optional `markdown` extra
- Responsive developer UI
- Unicode-safe filenames, URL encoding, and HTML escaping
- Browser auto-open
- Standard-library static file behavior underneath
- PyPI-ready wheel and source distribution

## Installation

```bash
python -m pip install pphs
```

For Markdown rendering:

```bash
python -m pip install "pphs[markdown]"
```

For development/build tools:

```bash
python -m pip install "pphs[dev]"
```

## Usage

```bash
pphs
pphs ./public
pphs ./public --port 3000
pphs ./public --host 0.0.0.0 --port 8000
pphs ./public --open
pphs ./public --host 0.0.0.0 --no-qr
```

Module form:

```bash
python -m pphs ./public --port 8000
```

### Connecting from your phone

Bind to `0.0.0.0` so devices on the same Wi-Fi can reach the server, e.g.
`pphs ./public --host 0.0.0.0`. A QR code pointing at your machine's LAN
address is printed in the terminal — scan it with your phone's camera to
open the server instantly. Pass `--no-qr` to skip it.

### Uploading files

Every directory page has a drag-and-drop zone (and a **Browse…** button) for
quickly sending files from another device into the folder being served. This
is handy for shuttling files to/from a phone or another computer on the same
network. There's currently no way to disable uploads from the CLI — keep
that in mind before pointing `pphs` at a directory on an untrusted network.

## Viewing files

Supported source/text files are opened in a dedicated viewer:

- Python
- JavaScript / TypeScript
- HTML
- CSS
- JSON
- Markdown
- YAML
- TOML
- SQL
- Shell
- and other formats recognized by Pygments

Markdown files are rendered when `Markdown` is installed; otherwise they
are shown as syntax-highlighted source.

## Security

This is intended for local development. Inline viewing is limited to
recognized text/source formats. File contents are HTML-escaped before being
inserted into the viewer. Static serving remains delegated to
`SimpleHTTPRequestHandler`. Anyone who can reach the server can also **upload
files into any directory being served** (uploaded filenames are sanitized
against path traversal, but there is no authentication). Only run `pphs` on
networks you trust.

## Thanks

Special thanks to my technical dudes, ChatGPT and Claude.


## License

MIT
