Metadata-Version: 2.1
Name: agraffe
Version: 0.1.0
Summary: Agraffe, build API with ASGI in Google Cloud Functions.
Home-page: https://github.com/odd12258053/agraffe
License: UNKNOWN
Author: odd
Author-email: odd12258053@gmail.com
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: MIT License
Requires-Dist: typing-extensions >=3.7.4, <4.0.0
Requires-Dist: mypy >=0.782, <1.0 ; extra == "dev"
Requires-Dist: black >=20.8b1 ; extra == "dev"
Requires-Dist: isort >=5.5.0, <6.0.0 ; extra == "dev"
Requires-Dist: flake8 >=3.8.3, <4.0.0 ; extra == "dev"
Requires-Dist: functions-framework >=2.0.0, <3.0.0 ; extra == "dev"
Provides-Extra: dev


Agraffe, build API with ASGI in Google Cloud Functions.

## Requirements

Python 3.7+

## Installation
```sh
$ pip install agraffe
```

## Example
Create it

- Create a file `mail.py` with:

```python
from agraffe import Agraffe

from typing import Optional

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
    return {"Hello": "World"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: Optional[str] = None):
    return {"item_id": item_id, "q": q}


def entry_point(request):
    agraffe = Agraffe(app)
    return agraffe(request)

```

Deploy it

- Deploy the api with:

```sh
$ gcloud functions deploy {FUNCTION NAME} --entry-point entry_point --runtime python37 --trigger-http --allow-unauthenticated
```

## License
This project is licensed under the terms of the MIT license.

