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

Library

from ghps import GHPageServer

server = GHPageServer(
    directory="dist",
    port=5000,
    base_path="/repo-name",
    strict=True,
    no_cache=False,
    threaded=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

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.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.2.tar.gz (13.6 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.2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ghps-0.2.tar.gz
Algorithm Hash digest
SHA256 3458c554be8dd61fbc0d5cee6f8fa6fe73872a93cef95d135be5dc42f87b12bb
MD5 430967c83e0eb5e0930cc9b38e67f66c
BLAKE2b-256 e3982d84b4951328866c854b71bca243120bd47a31900c476f6d6f14443035f8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ghps-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55676550f3548fbdb8952eeb6a6fcc816bc8467d240c40834a39c3bcb3a2139e
MD5 74684d577fae1a42b37bd4871a1dabf5
BLAKE2b-256 7077339463359ab0cea93b424ca119ba7de5c3466fe491bf23570012c0dc4d7d

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