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

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.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.1.tar.gz (11.5 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.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ghps-0.1.tar.gz
Algorithm Hash digest
SHA256 87aeaa75166105a67b4fa6b529d0b9db9852bd9904af3f2b450b351da59a78f6
MD5 1afff971bb09c8292c3f0b704d563f50
BLAKE2b-256 9b407fcc69b9a9cb242cd9aeda4fea72183c9ed7fa14659e3f63bc7ca0c3be07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ghps-0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dcae581a8f554205001a55c96a389e655590b10e0035f84a851263903b1dde8d
MD5 8ce80dd7ccfcccd209e9684f7322eb84
BLAKE2b-256 afa3d48820413cbfd6d00182e99aefc0b4a9620d06283871e0eb7d0f5d514fda

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