Metadata-Version: 2.4
Name: DefEssential
Version: 0.1.8
Summary: The Modern Synchronous Python Web Application Framework
Home-page: https://github.com/yong5eon/DefEssential
Author: Heo Yongseon
Project-URL: Source, https://github.com/yong5eon/DefEssential
Project-URL: Issues, https://github.com/yong5eon/DefEssential/issues
Project-URL: Releases, https://github.com/yong5eon/DefEssential/releases
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: gunicorn
Requires-Dist: gunicorn>=23; extra == "gunicorn"
Provides-Extra: uvicorn
Requires-Dist: uvicorn>=0.30; extra == "uvicorn"
Requires-Dist: a2wsgi>=1.10; extra == "uvicorn"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-python
Dynamic: summary

# DefEssential

The Modern Synchronous Python Web Application Framework

**Just def.**<br>
**Let web apps do the work.**<br>
**You don't need to await this.**

## Requirements

- Python 3.9 or later

## Installation

```bash
pip install DefEssential
```

The package includes a built-in Python HTTP server. Optional extras provide additional server adapters:

```bash
pip install "DefEssential[Gunicorn]"
pip install "DefEssential[Uvicorn]"
```

## Quick start

```python
from DefEssential import Application, Request, RequestRunner
from DefEssential.Adapter.Implements.Python import Server
from DefEssential.Responses import ResponseText


class Hello(RequestRunner, method='GET', url='/hello'):
  def run(self, request: Request):
    return ResponseText('Hello, world!')


application = Application()
application.add(Hello)
Server('127.0.0.1', 8000, application).run()
```

The handler declares an HTTP method and path on its `RequestRunner` class. The application registers the handler, and the server runs the application. A `GET /hello` request returns a plain-text response.

## Request handling

Define handlers as `RequestRunner` subclasses and implement `run()` with synchronous Python code. Configure path, query, header, and body validation in the class declaration. The framework also provides JSON, text, and file responses, direct streaming, Server-Sent Events, WebSocket support, and extensions for status checks, metrics, OpenAPI specifications, Swagger UI, and file serving.

## License

See the `LICENSE` file included with the source distribution for license terms.
