Skip to main content

Stardust is micro web framework inspired by serverless and lambda deployments.

Project description

Stardust

Micro framework inspired by the simple lambda or serveless deployment.

Usage:

$ pip install stardust

Create a file with a coroutine function that returns a dict, for example app.py:

async def serve(req):
    return {
      'hello': 'world'
    }

Now just start the framework, nothing more to do...

$ stardust app.py

You're up and running! 🎉

More complex cases

Apps with multiple files

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:

$ 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:

from .app import serve

And specify the module folder instead of a file:

$ stardust ./example_module

Apps with different responses

from stardust.responses import json

async def serve():
    return json(content={"hello":"world"}, status_code=200)

Contributing

Clone the project, install all the dependencies with:

$ pipenv install

Linting:

$ pipenv run lint

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

stardust-0.0.5rc1.tar.gz (5.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page