Metadata-Version: 2.1
Name: kristall
Version: 0.0.1
Summary: Lightweight web framework for building APIs and backends
Home-page: https://github.com/zgoda/kristall
Author: Jarek Zgoda
Author-email: jarek.zgoda@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Typing :: Typed
Requires-Python: ~=3.7
Description-Content-Type: text/x-rst
Requires-Dist: Werkzeug
Provides-Extra: dev
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: pytest-cov ; extra == 'dev'
Requires-Dist: pip ; extra == 'dev'
Requires-Dist: setuptools ; extra == 'dev'
Requires-Dist: wheel ; extra == 'dev'
Requires-Dist: ipython ; extra == 'dev'
Requires-Dist: ipdb ; extra == 'dev'
Requires-Dist: watchdog ; extra == 'dev'
Requires-Dist: termcolor ; extra == 'dev'
Requires-Dist: flake8 ; extra == 'dev'
Requires-Dist: flake8-builtins ; extra == 'dev'
Requires-Dist: flake8-bugbear ; extra == 'dev'
Requires-Dist: flake8-mutable ; extra == 'dev'
Requires-Dist: flake8-comprehensions ; extra == 'dev'
Requires-Dist: pep8-naming ; extra == 'dev'
Requires-Dist: dlint ; extra == 'dev'
Requires-Dist: towncrier ; extra == 'dev'
Requires-Dist: Sphinx ; extra == 'dev'
Requires-Dist: sphinx-autodoc-typehints ; extra == 'dev'
Requires-Dist: python-dotenv ; extra == 'dev'
Requires-Dist: doc8 ; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'

Kristall
========

.. image:: https://travis-ci.com/zgoda/kristall.svg?branch=master
    :target: https://travis-ci.com/zgoda/kristall
    :alt: Travis CI

.. image:: https://codecov.io/gh/zgoda/kristall/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/zgoda/kristall
    :alt: CodeCov

.. image:: https://www.codefactor.io/repository/github/zgoda/kristall/badge
    :target: https://www.codefactor.io/repository/github/zgoda/kristall
    :alt: CodeFactor

Lightweight *web framework*
(`wink, wink <https://www.youtube.com/watch?v=dlDXVI6uM78>`_)
for building APIs and backends.
Reasonably fast in execution, developer friendly. If you need gazillions of
requests served by single process in a second then there are better options
than Kristall. I'm happy when it's not slower than Flask.

Why
---

Some frameworks suck here, others suck there and none is good at all things
I want. I decided to build a WSGI application tool that's based on
`Werkzeug <https://palletsprojects.com/p/werkzeug/>`_ and is simpler than
Flask. Sure, there are
`Flask <https://palletsprojects.com/p/flask/>`_ extensions that make writing
REST APIs simpler like
`Flask-RESTFul <https://flask-restful.readthedocs.io/en/latest/>`_ and
`Flask-RESTPlus <https://flask-restplus.readthedocs.io/en/stable/>`_ but they
are built on top of Flask and do many extra things that are better done by
others, or not done at all. I wanted something that is somewhere in between
Falcon and Flask. Simplicity of Falcon with convenience of Flask.

But since not everything sucks in Falcon I'd grab some ideas, like
resourceful routing without need to subclass specific ``Resource`` base class,
or only static route registration.

What
----

* resourceful routing
* static route registration
* only JSON content type supported
* very limited automatic coercion to JSON

That's it for now.

Future developments:

* JWT-based resource access control (optional)
* CORS support (optional)

What not
--------

* no decorator-based route registration - there's only one way to register
  routes and it is explicit
* no built-in support for any other content type than ``application/json`` on
  both input and output
* no fancy JSON de/encoding, only builtin ``json`` module is used in default JSON
  handling - use schema parsing/validating library eg.
  `Marshmallow <https://marshmallow.readthedocs.io/en/stable/>`_ or
  `Colander <https://docs.pylonsproject.org/projects/colander/en/stable/>`_ if
  you need anything beyond that; default behaviour may be customised to some
  degree by providing JSON decoder and encoder classes

How
---

Really very thin wrapper over Werkzeug utility functions and classes.
Seriously, I'm not calling this *a framework*. Not yet. It consists of
``Application`` class that's and entry point to runtime and
``Request``/``Response`` objects that in fact are Werkzeug's built in
wrappers reconfigured to support only JSON as transport media with some
convenience methods.

Runtime dependencies
--------------------

* Python 3.7
* Werkzeug 0.16

These are minimal versions of requirements.


