Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

srcviewserver

A simple HTTP server that serves source files with syntax highlighting.

Source files with a recognized language extension are highlighted and wrapped in an HTML page.
All other files are served as-is (binary streaming). Directories get an HTML listing.

Installation

pip install srcviewserver

Usage

srcviewserver [--port PORT] [--host HOST]
Option Default Description
--host 127.0.0.1 Host/IP address to bind to.
--port -p 8000 Port to listen on.

Navigate to http://127.0.0.1:8000/ and browse the directory tree.

Testing

A self-contained smoke test exercises the response-building functions (directory listing, syntax highlighting, binary streaming, HEAD, and error responses):

python -m test.smoke_test

Run it with either Python 2 or Python 3 from the repository root.

Contributing

Contributions are welcome! Please submit pull requests or open issues on the GitHub repository.

License

This project is licensed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

srcviewserver-0.1.0a2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

srcviewserver-0.1.0a2-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file srcviewserver-0.1.0a2.tar.gz.

File metadata

  • Download URL: srcviewserver-0.1.0a2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for srcviewserver-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 2498aff9455660e88726dc839f7cf46257101d2dfcf5c1740619cd7c8aa87403
MD5 4a0ba02a102f7e68311c5cb5e23a868b
BLAKE2b-256 af52aaed7e2f554f48d8ca8cb1b40cf8da74f3321a5e47bfdf6ab589416843ff

See more details on using hashes here.

File details

Details for the file srcviewserver-0.1.0a2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for srcviewserver-0.1.0a2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 34c9570aa3a465cb527841fb9565f26973552e12f6ff376206e3890c88a5a87e
MD5 cd68b4ab1d2543f866a396fc00cdf3c8
BLAKE2b-256 11071a353dc5fa7b0f849a9547659b49e765167890d9e17a63243f55f937bbb8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0a2 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page