Skip to main content

A small and robust micro Python framework for building simple and solid web apps.

Project description

LESPY

GitHub stars Pytest Actions Status GitHub license PyPI PyPI download month PyPI pyversions PyPI - Wheel

Overview

A small and robust micro Python framework for building simple and solid web apps.

Quick start

DEMO: You can see a working examples here.

Instalation

Via PIP (recommended):

pip install lespy

Via Poetry:

poetry add lespy

Via GitHub:

git clone https://github.com/natanfeitosa/lespy.git && cd lespy && pip install .

Creating a simple app

In your main.py file import the App class from lespy

from lespy import App

Now instantiate the App class and pass it a name

app = App('first_app')

Now we need to create a route with the GET method

@app.get('/')
def home(request):
    return 'Hello world'

Yes, it's that simple.

Running the app

With the simple server included:

This is a simple implementation, do not use for production environment.

First import the run method

from lespy import run

Now let's use the method passing the App instance

if __name__ == '__main__':
    run(app)

Now, just run our python file, and if everything went well, just access in http://localhost:3000.

With Gunicorn:

$ gunicorn main:app

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

Lespy-0.1.2.tar.gz (15.6 kB view hashes)

Uploaded Source

Built Distribution

Lespy-0.1.2-py3-none-any.whl (20.4 kB view hashes)

Uploaded Python 3

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