A micro web framework inspired by serverless and lambda deployments, designed for simplicity and efficiency.
Install Stardust using pip:
pip install stardust
Requires Python 3.10 or higher.
Create a simple API in seconds with app.py
:
async def serve(req):
return {"hello": "world"}
Run your application:
stardust app.py
Your API will be available at http://localhost:8000
- π Minimal Setup: Create APIs with just a single function
- π Modern Python: Built for Python 3.10+ with full async support
- π CORS Enabled: Built-in CORS middleware for web applications
- β‘ Fast: Powered by Starlette and Uvicorn
- 𧩠Flexible Responses: Support for JSON, Plain Text, and custom Response objects
- π Developer Friendly: Debug mode and customizable logging
async def serve(req):
return {"message": "Hello, World!"}
from starlette.responses import PlainTextResponse
async def serve(req):
return PlainTextResponse("Hello, World!")
async def serve(req):
name = req.query_params.get("name", "world")
return {"hello": name}
async def serve(req):
body = await req.json()
return body # Echo back the request body
from starlette.responses import Response
async def serve(req):
return Response(status_code=204)
stardust [options] [file]
Options:
--port PORT Port number (default: 8000)
--host HOST Host address (default: 0.0.0.0)
--log-level LEVEL Logging level (default: error)
--debug Enable debug mode
To set up the development environment:
# Clone the repository
git clone https://github.com/lukefx/stardust
cd stardust
# Install development dependencies
uv sync --all-extras --dev
# Run tests
uv run pytest
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with:
Created by Luca Simone