An open API service indexing awesome lists of open source software.

https://github.com/natanfeitosa/lespy

A small and robust python micro framework for building simple and solid web apps.
https://github.com/natanfeitosa/lespy

apps framework lespy pypi python python3 web wsgi-framework

Last synced: 2 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# LESPY

[![GitHub stars](https://img.shields.io/github/stars/natanfeitosa/lespy.svg)](https://github.com/natanfeitosa/lespy/stargazers)
[![Pytest Actions Status](https://github.com/natanfeitosa/lespy/actions/workflows/pytest.yml/badge.svg)](https://github.com/natanfeitosa/lespy/actions)
[![GitHub license](https://img.shields.io/github/license/natanfeitosa/lespy.svg)](https://github.com/natanfeitosa/lespy/blob/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/lespy.svg)](https://pypi.org/project/lespy)
[![PyPI download month](https://img.shields.io/pypi/dm/lespy.svg)](https://pypi.org/project/lespy/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/lespy.svg)](https://pypi.python.org/pypi/lespy/)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/lespy.svg)
[![Open Source Helpers](https://www.codetriage.com/natanfeitosa/lespy/badges/users.svg)](https://www.codetriage.com/natanfeitosa/lespy)

## 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](./examples).

### Instalation

Via PIP (recommended):

```bash
pip install lespy
```

Via Poetry:
```bash
poetry add lespy
```

Via GitHub:

```bash
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`
```python
from lespy import App
```

Now instantiate the App class and pass it a name
```python
app = App('first_app')
```

Now we need to create a route with the GET method
```python
@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
```python
from lespy import run
```

Now let's use the method passing the App instance
```python
if __name__ == '__main__':
run(app)
```

Now, just run our python file, and if everything went well, just access in .

**_With Gunicorn:_**

```bash
$ gunicorn main:app
```