Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukefx/stardust
Micro Python web framework inspired by serverless framework and lambda functions
https://github.com/lukefx/stardust
microframework python rest web
Last synced: about 2 months ago
JSON representation
Micro Python web framework inspired by serverless framework and lambda functions
- Host: GitHub
- URL: https://github.com/lukefx/stardust
- Owner: lukefx
- License: mit
- Created: 2020-11-14T09:43:44.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-01T12:06:45.000Z (2 months ago)
- Last Synced: 2024-11-01T13:18:20.260Z (2 months ago)
- Topics: microframework, python, rest, web
- Language: Python
- Homepage:
- Size: 57.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Stardust
Micro framework inspired by the simple lambda or serveless deployment.
### Usage:
```sh
$ pip install stardust
```Create a file with a coroutine function that returns a dict, for example `app.py`:
```python
async def serve(req):
return {
'hello': 'world'
}
```Now just start the framework, nothing more to do...
```sh
$ stardust app.py
```You're up and running! 🎉
### More complex cases
For more complex cases or apps that are not just one function, Stardust is also able to use a module as starting point.
Create a Python module:
```sh
$ tree example_module
example_module
├── __init__.py
└── app.py
```Let's assume app is a complex app with many functions, you can find an example into the `examples` folder.
The module should export only the main function that Stardust will use as entrypoint:```python
from .app import serve
```And specify the module folder instead of a file:
```sh
$ stardust ./example_module
```### Contributing
Clone the project, install all the dependencies with:
```bash
$ uv python install 3.13
$ uv sync
```Testing and linting
```bash
$ uv run pytest
$ uv tool run ruff format .
```