Metadata-Version: 2.1
Name: eztea
Version: 0.1.8
Summary: EZTea Web Framework
Home-page: https://github.com/guyskk/eztea
License: MIT
Keywords: web,framework,development
Author: guyskk
Author-email: guyskk@qq.com
Requires-Python: >=3.9.7,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development
Provides-Extra: django
Provides-Extra: falcon
Provides-Extra: migration
Provides-Extra: mysql
Provides-Extra: postgresql
Provides-Extra: testing
Requires-Dist: alembic (>=1.7.5); extra == "migration"
Requires-Dist: black (>=21.12b0); extra == "migration"
Requires-Dist: ciso8601 (>=2.2.0)
Requires-Dist: click (>=7.1.2); extra == "migration"
Requires-Dist: coverage (>=6.3.2); extra == "testing"
Requires-Dist: cryptography (>=36.0.1,<37.0.0); extra == "mysql"
Requires-Dist: django (>=4.0.3); extra == "django"
Requires-Dist: falcon (>=3.0.1); extra == "falcon"
Requires-Dist: httpx (>=0.22.0); extra == "testing"
Requires-Dist: mako (>=1.1.6); extra == "migration"
Requires-Dist: psycopg2 (>=2.9.3); extra == "postgresql"
Requires-Dist: pymysql (>=1.0.2); extra == "mysql"
Requires-Dist: pytest (>=6.2.5); extra == "testing"
Requires-Dist: pytest-cov (>=3.0.0); extra == "testing"
Requires-Dist: pytest-env (>=0.6.2); extra == "testing"
Requires-Dist: python-dateutil (>=2.8.2); extra == "migration"
Requires-Dist: python-dotenv (>=0.12.0)
Requires-Dist: sqlalchemy (>=1.3.19); extra == "falcon"
Requires-Dist: sqlalchemy-jsonfield (>=1.0.0); extra == "falcon"
Requires-Dist: sqlalchemy-utc (>=0.14.0); extra == "falcon"
Requires-Dist: sqlalchemy-utils (>=0.38.2); extra == "falcon"
Requires-Dist: validr (>=1.2.1)
Project-URL: Repository, https://github.com/guyskk/eztea
Description-Content-Type: text/markdown

# EZTea Web Framework

```bash
# use falcon
pip install eztea[falcon,mysql,migration,testing]

# use django
pip install eztea[django,postgresql,testing]
```

## Usage

### Falcon Example

```python
from validr import T

from eztea.falcon import Application, ResponderContext, Router

router = Router()


@router.get("/")
def hello(
    ctx: ResponderContext,
    name: str = T.str.default("world"),
) -> T.dict(hello=T.str):
    return {"hello": name}


app = Application()
app.include_router(router)
```

### Django Example

```python
from validr import T

from django.http import HttpRequest
from eztea.django import Router

router = Router()


@router.get("/")
def hello(
    req: HttpRequest,
    name: str = T.str.default("world"),
) -> T.dict(hello=T.str):
    return {"hello": name}


urls = router.to_url_s()
```

### Testing Example

```python
from eztea.falcon.testing import WebTestClient
from eztea.django.testing import WebTestClient
from myapp.wsgi import application

def test_hello():
    client = WebTestClient(application)
    response = client.get('/')
    assert response.status_code == 200
    assert reesponse.json() == {"hello": "world"}
```

