# 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"}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/guyskk/eztea",
"name": "eztea",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9.7",
"maintainer_email": null,
"keywords": "web, framework, development",
"author": "guyskk",
"author_email": "guyskk@qq.com",
"download_url": "https://files.pythonhosted.org/packages/2d/7f/e4ed06c7ffb88a99470277e82c40e27dd3fd10235bda0ab9f76c41f9d9b6/eztea-0.1.12.tar.gz",
"platform": null,
"description": "# EZTea Web Framework\n\n```bash\n# use falcon\npip install eztea[falcon,mysql,migration,testing]\n\n# use django\npip install eztea[django,postgresql,testing]\n```\n\n## Usage\n\n### Falcon Example\n\n```python\nfrom validr import T\n\nfrom eztea.falcon import Application, ResponderContext, Router\n\nrouter = Router()\n\n\n@router.get(\"/\")\ndef hello(\n ctx: ResponderContext,\n name: str = T.str.default(\"world\"),\n) -> T.dict(hello=T.str):\n return {\"hello\": name}\n\n\napp = Application()\napp.include_router(router)\n```\n\n### Django Example\n\n```python\nfrom validr import T\n\nfrom django.http import HttpRequest\nfrom eztea.django import Router\n\nrouter = Router()\n\n\n@router.get(\"/\")\ndef hello(\n req: HttpRequest,\n name: str = T.str.default(\"world\"),\n) -> T.dict(hello=T.str):\n return {\"hello\": name}\n\n\nurls = router.to_url_s()\n```\n\n### Testing Example\n\n```python\nfrom eztea.falcon.testing import WebTestClient\nfrom eztea.django.testing import WebTestClient\nfrom myapp.wsgi import application\n\ndef test_hello():\n client = WebTestClient(application)\n response = client.get('/')\n assert response.status_code == 200\n assert reesponse.json() == {\"hello\": \"world\"}\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "EZTea Web Framework",
"version": "0.1.12",
"project_urls": {
"Homepage": "https://github.com/guyskk/eztea",
"Repository": "https://github.com/guyskk/eztea"
},
"split_keywords": [
"web",
" framework",
" development"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "822551bfa1a3eb65a49864704b4eea9937cca6f20fd6c2b315cb1d2fa2715a3e",
"md5": "2018ad2c4b1c27685d146ac57702cb77",
"sha256": "906c88f7d61acc222c49fea8e53cd4197ff11cb74d35aa0fb3efdf59b38fe5ba"
},
"downloads": -1,
"filename": "eztea-0.1.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2018ad2c4b1c27685d146ac57702cb77",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9.7",
"size": 28149,
"upload_time": "2024-09-20T07:42:06",
"upload_time_iso_8601": "2024-09-20T07:42:06.871042Z",
"url": "https://files.pythonhosted.org/packages/82/25/51bfa1a3eb65a49864704b4eea9937cca6f20fd6c2b315cb1d2fa2715a3e/eztea-0.1.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2d7fe4ed06c7ffb88a99470277e82c40e27dd3fd10235bda0ab9f76c41f9d9b6",
"md5": "902bd56e585a2b404d1c467996d20b63",
"sha256": "2b19db4e8209eca0f5306c0867acc71600c9fe08a8541f8823634238cda10dbe"
},
"downloads": -1,
"filename": "eztea-0.1.12.tar.gz",
"has_sig": false,
"md5_digest": "902bd56e585a2b404d1c467996d20b63",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9.7",
"size": 20034,
"upload_time": "2024-09-20T07:42:08",
"upload_time_iso_8601": "2024-09-20T07:42:08.528987Z",
"url": "https://files.pythonhosted.org/packages/2d/7f/e4ed06c7ffb88a99470277e82c40e27dd3fd10235bda0ab9f76c41f9d9b6/eztea-0.1.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-20 07:42:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "guyskk",
"github_project": "eztea",
"github_not_found": true,
"lcname": "eztea"
}