Skip to main content

Ghps: A Minimal GitHub Pages Simulator for Local Development

Project description

Ghps: A Minimal GitHub Pages Simulator for Local Development


built with Python3 GitHub repo size PyPI version

Overview

Ghps is a minimal, zero-dependency GitHub Pages simulator written in pure Python for local development and testing. It accurately replicates GitHub Pages' static hosting behavior, including proper 404.html handling, project base path simulation, strict routing mode, and optional cache control - all while remaining lightweight, fast, and usable both as a CLI tool and as an importable Python library.

PyPI Counter
Github Stars
Branch main dev
CI
Code Quality CodeFactor

Installation

Source Code

PyPI

Usage

Ghps can be used both as a CLI tool and as a Python library.

CLI

ghps --port=8080 --no-cache --no-threaded

Options

Option Description Default
-p, --port Port to serve on 8000
-d, --directory Directory to serve Current directory (.)
-b, --base-path Base path for project pages (e.g. /repo-name) ""
--no-strict Enable .html fallback Strict mode enabled
--no-cache Disable HTTP caching headers Cache enabled
--no-threaded Disable threaded server Threaded enabled
--auto-open Automatically open the server URL Disable

ℹ️ You can set --port=0 to let the OS automatically select an available port

Library

from ghps import GHPageServer

server = GHPageServer(
    directory="dist",
    port=5000,
    base_path="/repo-name",
    strict=True,
    no_cache=False,
    threaded=True,
	auto_open=True,
)

server.start()

Parameters

Parameter Type Description Default
directory str Directory to serve "."
port int Port number 8000
base_path str Base path for project page simulation ""
strict bool Enforce GitHub-like routing behavior True
no_cache bool Disable cache headers False
threaded bool Enable threaded request handling True
auto_open bool Automatically open the server URL False

ℹ️ You can set port=0 to let the OS automatically select an available port

Issues & Bug Reports

Just fill an issue and describe it. We'll check it ASAP!

  • Please complete the issue template

Show Your Support

Star This Repo

Give a ⭐️ if this project helped you!

Donate to Our Project

Bitcoin

1KtNLEEeUbTEK9PdN6Ya3ZAKXaqoKUuxCy

Ethereum

0xcD4Db18B6664A9662123D4307B074aE968535388

Litecoin

Ldnz5gMcEeV8BAdsyf8FstWDC6uyYR6pgZ

Doge

DDUnKpFQbBqLpFVZ9DfuVysBdr249HxVDh

Tron

TCZxzPZLcJHr2qR3uPUB1tXB6L3FDSSAx7

Ripple

rN7ZuRG7HDGHR5nof8nu5LrsbmSB61V1qq

Binance Coin

bnb1zglwcf0ac3d0s2f6ck5kgwvcru4tlctt4p5qef

Tether

0xcD4Db18B6664A9662123D4307B074aE968535388

Dash

Xd3Yn2qZJ7VE8nbKw2fS98aLxR5M6WUU3s

Stellar

GALPOLPISRHIYHLQER2TLJRGUSZH52RYDK6C3HIU4PSMNAV65Q36EGNL

Zilliqa

zil1knmz8zj88cf0exr2ry7nav9elehxfcgqu3c5e5

Coffeete

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

0.4 - 2026-05-08

Added

  • GHPSError class
  • GHPSValidationError class
  • GHPSRuntimeError class
  • Port error messages

Changed

  • Test system modified

0.3 - 2026-04-05

Added

  • auto_open parameter
  • --auto-open CLI argument
  • Random port support

Changed

  • Test system modified
  • CLI error messages updated
  • README.md updated

0.2 - 2026-03-19

Added

  • Logo
  • Input validation

Changed

  • Test system modified
  • README.md updated

0.1 - 2026-02-27

Added

  • GHPageServer class
  • Command line interface
  • Test system

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

ghps-0.4.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

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

ghps-0.4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file ghps-0.4.tar.gz.

File metadata

  • Download URL: ghps-0.4.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ghps-0.4.tar.gz
Algorithm Hash digest
SHA256 a827f9fe00955b27cbdaeb030f9970ec30c8099cb98cc79a7894a70584df7891
MD5 1875b7ee38bbc1ae40f0fb6ac40ea6b2
BLAKE2b-256 61b3bdae07e52876ad990da3567b745c1267b480f2d76a9de54e812d54717582

See more details on using hashes here.

File details

Details for the file ghps-0.4-py3-none-any.whl.

File metadata

  • Download URL: ghps-0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ghps-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e1817d7e054d4228c223d38af624ef36816af02fd2de74e0a9c3dceaa7701388
MD5 41a0f187b95c6bdebabd0ea835829703
BLAKE2b-256 f9b71b730936ac2051e23f84a255d45537a8e9ea8a38e1d463a0edd7375d1a1e

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