Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/thevahidal/another

🕳️ "Another" Python backend framework, for fun.
https://github.com/thevahidal/another

backend framework python

Last synced: 10 days ago
JSON representation

🕳️ "Another" Python backend framework, for fun.

Awesome Lists containing this project

README

        

# Another
"Another" Python backend framework, for fun.

[![justforfunnoreally.dev badge](https://img.shields.io/badge/justforfunnoreally-dev-9ff)](https://justforfunnoreally.dev)

## Installation

```bash
pip install another
```

You also need an ASGI server, such as [Uvicorn](https://github.com/encode/uvicorn) or [Granian](https://github.com/emmett-framework/granian).

```bash
pip install uvicorn
# or
pip install granian
```

## Usage

Create a `main.py` file and copy-paste the following snippet into it.

```python
from another import Another, Status, Request, Response

app = Another()

@app.get("/hello")
def hellow_another(req: Request):
return Response({
"message": "Hello!",
"extra": req.query
}, status=Status.HTTP_200_OK)
```

And then run the server:

```bash
uvicorn main:app
```

Now open this link [localhost:8000/hello?first_name=Mads&last_name=Mikkelsen](http://localhost:8000/hello?first_name=Mads&last_name=Mikkelsen) in your browser.