Metadata-Version: 2.1
Name: artless-framework
Version: 0.1.0
Summary: Artless and minimalistic web framework without dependencies, working over WSGI.
Author-email: Peter Bro <p3t3rbr0@gmail.com>
Project-URL: Homepage, https://github.com/p3t3rbr0/py3-artless-framework
Project-URL: Documentation, https://github.com/p3t3rbr0/py3-artless-framework/blob/master/README.md
Project-URL: Repository, https://github.com/p3t3rbr0/py3-artless-framework.git
Project-URL: Issues, https://github.com/p3t3rbr0/py3-artless-framework/issues
Project-URL: Changelog, https://github.com/p3t3rbr0/py3-artless-framework/blob/master/CHANGELOG.md
Keywords: artless,minimalistic,web,framework
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: build
Requires-Dist: build==1.2.1; extra == "build"
Requires-Dist: twine==5.1.1; extra == "build"
Provides-Extra: dev
Requires-Dist: coverage==7.6.1; extra == "dev"
Requires-Dist: mypy==1.11.1; extra == "dev"
Requires-Dist: isort==5.13.2; extra == "dev"
Requires-Dist: flake8==7.1.1; extra == "dev"
Requires-Dist: black==24.8.0; extra == "dev"
Requires-Dist: pydocstyle==6.3.0; extra == "dev"

# artless-framework

<!-- ![Build Status](https://github.com/p3t3rbr0/py3-artless-framework/actions/workflows/ci.yaml/badge.svg?branch=master) -->
[![Downloads](https://static.pepy.tech/badge/artless-framework)](https://pepy.tech/project/artless-framework)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/artless-framework)
![PyPI Version](https://img.shields.io/pypi/v/artless-framework)
<!-- [![Code Coverage](https://codecov.io/gh/p3t3rbr0/py3-artless-framework/graph/badge.svg?token=N7J33ZOKVO)](https://codecov.io/gh/p3t3rbr0/py3-artless-framework) -->
<!-- [![Maintainability](https://api.codeclimate.com/v1/badges/76cc047808f3dc53de01/maintainability)](https://codeclimate.com/github/p3t3rbr0/py3-artless-framework/maintainability) -->

The artless and minimalistic web framework without dependencies, working over WSGI.

## Main principles

1. Artless, fast and small (less then 1000 LOC) WSGI-framework.
2. No third party dependencies (standart library only).
3. Support only modern versions of Python (>=3.10).
4. Integrated with most popular WSGI-servers.
5. Mostly pure functions without side effects.
6. Interfaces with type annotations.
7. Comprehensive documentation with examples of use.
8. Full test coverage.

## Limitations

* No built-in support for working with `Cookies`.
* Requests with `multipart/form-data` content-type are not supported.
* No built-in protections, such as: CSRF, XSS, clickjacking and other attack techniques.

## Usages

``` python
from os import getenv

from artless import App, Request, Response, ResponseFactory


def say_hello(request: Request, username: str) -> Response:
    return ResponseFactory.plain(f"Hello, {username}!")


def create_application(config) -> App:
    app = App(config)
    app.set_routes((("GET", r"^/hello/(?P<username>\w+)/$", say_hello),))
    return app


config = {
    "DEBUG": True,
}

application = create_application(config)

if __name__ == "__main__":
    from wsgiref.simple_server import make_server

    host = getenv("HOST", "127.0.0.1")
    port = int(getenv("PORT", 8000))

    with make_server(host, port, application) as httpd:
        print(f"Started WSGI server on {host}:{port}")
        httpd.serve_forever()
```

Run it:

``` shellsession
$ python3 app.py
Started WSGI server on 127.0.0.1:8000
```

Check it:

``` shellsession
$ curl http://127.0.0.1:8000/hello/Peter/
Hello, Peter!
```

See more [examples](https://git.peterbro.su/peter/py3-artless-framework/src/branch/master/examples).

## Roadmap

- [ ] Add plugin support.
- [ ] Add cookies support.
- [ ] Add async interface.
- [ ] Add `multipart/form-data` support.
- [ ] Add test client.
- [ ] Add benchmarks.
- [ ] Add more examples.
