Skip to main content

microweb framework

Project description

rivr

rivr is a Python WSGI Compatible microweb framework. Following a design similar to Django.

Examples

Simple views

def hello_world(request):
    return Response('Hello, World!', content_type='text/plain')

Routing

router = Router()

@router.register(r'^$')
def index(request):
    return Response('Hello world.')

@router.register(r'^test/$')
def test(request):
    return Response('Testing!')

Class based views

class ExampleView(View):
    def get(self, request):
        return Response('Hi')

Testing

rivr exposes a TestClient which allows you to create requests and get a response. Simply pass the TestClient your view, router or application and you can make requests using the testing DSL to get a response.

from rivr.tests import TestClient

class TestCase(unittest.TestCase):
    def setUp(self):
        self.client = TestClient(router)

    def test_status(self):
        assert self.client.get('/status/').status_code is 204

License

rivr is released under the BSD license. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rivr-0.10.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

rivr-0.10.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file rivr-0.10.0.tar.gz.

File metadata

  • Download URL: rivr-0.10.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for rivr-0.10.0.tar.gz
Algorithm Hash digest
SHA256 688fb1cb2906854e681aeb0d1b8b390b12b3cae54a76fbf9b13e18f9183b4690
MD5 b6f253e0b17e64e6914c3c6ef9c72117
BLAKE2b-256 50662a2b3a61777d478f1e7a0258409170e2f26dbfbe76d786fe2594100b3f9a

See more details on using hashes here.

File details

Details for the file rivr-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: rivr-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.9

File hashes

Hashes for rivr-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da3e75e99489189ecb8ada796f31654ebf251a097ec12f90eab63d29e6f280d3
MD5 f64d788d8c709f1fde72663de604673a
BLAKE2b-256 875099b341c246118012da38e5a4066e1006ff795038e15dc6513da6de0fb74d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page