Some checks failed
Lint Code / lint (push) Failing after 37s
CI/CD Pipeline / lint (push) Successful in 0s
Run Tests / test (3.12) (push) Successful in 37s
Run Tests / test (3.13) (push) Successful in 1m0s
CI/CD Pipeline / test (push) Successful in 0s
CI/CD Pipeline / build-and-release (push) Has been skipped
CI/CD Pipeline / notify (push) Successful in 1s
PyServe
PyServe is a modern, async HTTP server written in Python. Originally created for educational purposes, it has evolved into a powerful tool for rapid prototyping and serving web applications with unique features like AI-generated content.
Project Overview
PyServe v0.6.0 introduces a completely refactored architecture with modern async/await syntax and new exciting features like Vibe-Serving - AI-powered dynamic content generation.
Key Features:
- Async HTTP Server - Built with Python's asyncio for high performance
- Advanced Configuration System V2 - Powerful extensible configuration with full backward compatibility
- Regex Routing & SPA Support - nginx-style routing patterns with Single Page Application fallback
- Static File Serving - Efficient serving with correct MIME types
- Template System - Dynamic content generation
- Vibe-Serving Mode - AI-generated content using language models (OpenAI, Claude, etc.)
- Reverse Proxy - Forward requests to backend services with advanced routing
- SSL/HTTPS Support - Secure connections with certificate configuration
- Modular Extensions - Plugin-like architecture for security, caching, monitoring
- Beautiful Logging - Colored terminal output with file rotation
- Error Handling - Styled error pages and graceful fallbacks
- CLI Interface - Command-line interface for easy deployment and configuration
Getting Started
Prerequisites
- Python 3.12 or higher
- Poetry (recommended) or pip
Installation
Via Poetry (рекомендуется)
git clone https://github.com/ShiftyX1/PyServe.git
cd PyServe
make init # Initialize project
Или установка пакета
# local install
make install-package
# after installing project you can use command pyserve
pyserve --help
Running the Server
Using Makefile (recommended)
# start in development mode
make run
# start in production mode
make run-prod
# show all available commands
make help
Using CLI directly
# after installing package
pyserve
# or with Poetry
poetry run pyserve
# or legacy (for backward compatibility)
python run.py
CLI options
# help
pyserve --help
# path to config
pyserve -c /path/to/config.yaml
# rewrite host and port
pyserve --host 0.0.0.0 --port 9000
# debug mode
pyserve --debug
# show version
pyserve --version
Development
Makefile Commands
make help # Show help for commands
make install # Install dependencies
make dev-install # Install development dependencies
make build # Build the package
make test # Run tests
make test-cov # Tests with code coverage
make lint # Check code with linters
make format # Format code
make clean # Clean up temporary files
make version # Show version
make publish-test # Publish to Test PyPI
make publish # Publish to PyPI
Project Structure
pyserveX/
├── pyserve/ # Main package
│ ├── __init__.py
│ ├── cli.py # CLI interface
│ ├── server.py # Main server module
│ ├── config.py # Configuration system
│ ├── routing.py # Routing
│ ├── extensions.py # Extensions
│ └── logging_utils.py
├── tests/ # Tests
├── static/ # Static files
├── templates/ # Templates
├── logs/ # Logs
├── Makefile # Automation tasks
├── pyproject.toml # Project configuration
├── config.yaml # Server configuration
└── run.py # Entry point (backward compatibility)
License
This project is distributed under the MIT license.
PyServeX v0.9.10
Latest
Languages
Python
96%
Makefile
1.9%
Cython
1.4%
Shell
0.7%