Skip to main content

Build Status Build Status Coverage Status PyPI - License Python Versions Open Source Love Documentation Status

Eynnyd web framework logo

Eynnyd Web Framework

Eynnyd (pronounced [Ey-nahyd]) is an acronym for Everything You Need, Nothing You Don't. It is a light-weight WSGI compliant python 3 web framework. Eynnyd was designed with the primary goal to not impose bad engineering decisions on it's users. It is also designed to not overstep or assume the wants of it's user.

Simplicity and Freedom is the Design

This is the framework for you if the following sound good:

  • You are permitted but not coerced into following REST.
  • A request handler takes a request and returns a response.
  • A request interceptor takes a request and returns a request.
  • A response interceptor takes a request and a response and returns a response.
  • You can have any number of request interceptors, request handlers, or response interceptors.
  • You can name your handler methods anything you want.
  • You can limit the scope (paths it applies to) of any interceptor.
  • We do not provide extraneous dependencies or opinions (like database connection libraries or templating engines)
  • There is no Eynnyd way to do things.
  • There is nothing clever or magic. (like global singletons or special decorators)
  • You can see your entire routing layout, succinctly, in your main.

If this at all sounds good we recommend you keep reading and see what else Eynnyd can provide for you.

Documents

Read the documents at eynnyd.readthedocs.io

How to install it

Eynnyd is published to pypi and can be installed using:

pip install eynnyd

How to use it

Eynnyd does not come with a built in WSGI HTTP server. We recommend gunicorn for running your application.

A simple hello world example looks like:

# hello_world_app.py
from eynnyd import RoutesBuilder
from eynnyd import EynnydWebappBuilder
from eynnyd import ResponseBuilder
from http import HTTPStatus

def hello_world(request):
    return ResponseBuilder()\
        .set_status(HTTPStatus.OK)\
        .set_utf8_body("Hello World")\
        .build()


def build_application():
    routes = \
        RoutesBuilder()\
            .add_handler("GET", "/hello", hello_world)\
            .build()

    return EynnydWebappBuilder()\
            .set_routes(routes)\
            .build()

application = build_application()

Using gunicorn this can now be run gunicorn hello_world_app.

An example with interceptors

# hello_world_app.py
import logging

from eynnyd import RoutesBuilder
from eynnyd import EynnydWebappBuilder
from eynnyd import ResponseBuilder
from http import HTTPStatus

LOG = logging.getLogger("hello_world_app")

def hello_world(request):
    return ResponseBuilder()\
        .set_status(HTTPStatus.OK)\
        .set_utf8_body("Hello World")\
        .build()

def log_request(request):
    LOG.info("Got Request: {r}".format(r=request))
    return request

def log_response(request, response):
    LOG.info("Built Response: {s} for Request: {r}".format(s=response, r=request))
    return response

def build_application():
    routes = \
        RoutesBuilder()\
            .add_request_interceptor("/hello", log_request)\
            .add_handler("GET", "/hello", hello_world)\
            .add_response_interceptor("/hello", log_response)\
            .build()

    return EynnydWebappBuilder()\
            .set_routes(routes)\
            .build()

application = build_application()

For Developers / Contributors

Installing requirements

run:

pip install -r test_requirements.txt

Running the tests

After installing the requirements run:

python -m unittest discover tests

Checking coverage

After installing the requirements run:

coverage run --source eynnyd/ -m unittest discover tests/
coverage report

Metadata

Release files for eynnyd 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eynnyd 0.4.1
File Size Uploaded Provenance
eynnyd-0.4.1.tar.gz 38.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for eynnyd 0.4.1
File Interpreter ABI Platform
eynnyd-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 101.6 kB

Release files / eynnyd-0.4.1.tar.gz

Download URL eynnyd-0.4.1.tar.gz
Size 38.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0756312e9e478153c09435ba089030945035cb7ae8f67c76ca8cec9b13c4f36e
BLAKE2b-256 checksum
How to use checksums
07f01b1c20fab13bc7d8c3e871a167fedf7d9a6efefb3bb29553f52f9da0805d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.4

Release files / eynnyd-0.4.1-py3-none-any.whl

Download URL eynnyd-0.4.1-py3-none-any.whl
Size 62.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbdff856c7bc16352c47aac5f7fa3de02f05cebbf274e07414c5058eddd9eeb5
BLAKE2b-256 checksum
How to use checksums
9dd779a6a85b4432c90a8cfa40da0ba87b495f707d531ed0c43faa5f104a02ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.4

Security for eynnyd 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page