Skip to main content

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 --host=127.0.0.1 --port=8080 --no-cache --no-threaded

Options

Option Description Default
--host Host address to bind to localhost
-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
--directory-listing Enable directory listing Disable

Library

from ghps import GHPageServer

server = GHPageServer(
    directory="dist",
	host="localhost",
    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 "."
host str Host address to bind the server to "localhost"
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
directory_listing bool Enable directory listing False

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.7 - 2026-09-22

Added

  • host parameter
  • --host CLI argument

Changed

  • Test system modified
  • README.md updated

0.6 - 2026-08-31

Added

  • Custom default error page

Changed

  • Server header modified

0.5 - 2026-08-02

Added

  • directory_listing parameter
  • --directory-listing CLI argument

Changed

  • 404 page headers modified
  • Port validation bug fixed
  • GHPageServer class start method modified
  • Error messages updated
  • Dependencies structure modified
  • Test system modified
  • README.md updated

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

Metadata

Release files for ghps 0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghps 0.7
File Size Uploaded
ghps-0.7.tar.gz 18.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ghps 0.7
File Interpreter ABI Platform
ghps-0.7-py3-none-any.whl Python 3 none any Details

Total release size: 30.5 kB

Release files / ghps-0.7.tar.gz

Download URL ghps-0.7.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6896a73a6ab9329bdd96e42378475960a4883f5a8023d0f340714fdb824eb6d9
BLAKE2b-256 checksum
How to use checksums
dcb56ffa43019e29a0209780b9c5d68214691d597462a19272f87cc74c60f6f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / ghps-0.7-py3-none-any.whl

Download URL ghps-0.7-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9a025ba4cdf898042781cb71e8026843c223504ca27f14d670bcd6c3e24e22f
BLAKE2b-256 checksum
How to use checksums
e5b43b132f3cf846ab4c73354cddfb7081863e2b5232ec33846aba4221f809e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.7 This release

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

0.0.0

2 release 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