Skip to content

Commit

Permalink
use rst format for README
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuerke Erik committed Mar 9, 2020
1 parent a9a79b1 commit 8546c1f
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 55 deletions.
52 changes: 0 additions & 52 deletions README.md

This file was deleted.

62 changes: 62 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
RestIt
======

.. image:: https://readthedocs.org/projects/restit/badge/?version=latest
:target: https://restit.readthedocs.io/en/latest/?badge=latest

.. image:: https://coveralls.io/repos/github/Rollmops/restit/badge.svg?branch=master
:target: https://coveralls.io/github/Rollmops/restit?branch=master

.. image:: https://github.com/Rollmops/restit/workflows/Python%20package/badge.svg
:target: https://github.com/Rollmops/restit/workflows/Python%20package/badge.svg

Python HTTP REST library including OOP-readiness and Open-API generation

Feature
-------

- `WSGI <https://www.python.org/dev/peps/pep-3333/>`_ conform
- Validation (using `marshmallow <https://marshmallow.readthedocs.io/en/stable/>`_):
- query parameter validation
- path parameter validation
- request body validation
- response body validation
- `OpenApi <https://swagger.io/docs/specification/about/>`_ documentation generation
- *OOP* ready (no module-based global instances necessary)
- Easy to test
- very few dependencies

Quick example
-------------

.. code-block:: python
from restit.request import Request
from restit.request_mapping import request_mapping
from restit.resource import Resource
from restit.response import Response
from restit.restit_app import RestitApp
@request_mapping("/")
class IndexResource(Resource):
def get(self, request: Request) -> Response:
return Response("Hello from index.")
app = RestitApp(resources=[IndexResource()])
if __name__ == "__main__":
app.start_development_server()
You can also use a production-ready server like [Gunicorn](#https://gunicorn.org/)
(given the name of the above module is *restit_app_test.py*):

.. code-block:: bash
gunicorn -w 4 restit_app_test:app
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# -- Project information -----------------------------------------------------

project = 'restit'
copyright = '2018, Erik Tuerke'
copyright = '2020, Erik Tuerke'
author = 'Erik Tuerke'

# The short X.Y version
Expand Down
51 changes: 49 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Welcome to RestIt's documentation!
=====================================
RestIt
======

.. image:: https://readthedocs.org/projects/restit/badge/?version=latest
:target: https://restit.readthedocs.io/en/latest/?badge=latest
Expand All @@ -12,6 +12,53 @@ Welcome to RestIt's documentation!

Python HTTP REST library including OOP-readiness and Open-API generation

Feature
-------

- `WSGI <https://www.python.org/dev/peps/pep-3333/>`_ conform
- Validation (using `marshmallow <https://marshmallow.readthedocs.io/en/stable/>`_):
- query parameter validation
- path parameter validation
- request body validation
- response body validation
- `OpenApi <https://swagger.io/docs/specification/about/>`_ documentation generation
- *OOP* ready (no module-based global instances necessary)
- Easy to test
- very few dependencies

Quick example
-------------

.. code-block:: python
from restit.request import Request
from restit.request_mapping import request_mapping
from restit.resource import Resource
from restit.response import Response
from restit.restit_app import RestitApp
@request_mapping("/")
class IndexResource(Resource):
def get(self, request: Request) -> Response:
return Response("Hello from index.")
app = RestitApp(resources=[IndexResource()])
if __name__ == "__main__":
app.start_development_server()
You can also use a production-ready server like [Gunicorn](#https://gunicorn.org/)
(given the name of the above module is *restit_app_test.py*):

.. code-block:: bash
gunicorn -w 4 restit_app_test:app
.. toctree::
:maxdepth: 2
:caption: Contents:
Expand Down

0 comments on commit 8546c1f

Please sign in to comment.