Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

nameko-design

logo

Generate Nameko http files from design schema inspired by goa

Dependencies

Installation

cd nameko-design
poetry install

Usage

cd nameko-design
poetry run nameko-design nameko_design/sample.py

Design

This API design schema

with Service('http_service'):
    Title('This is a http service')

    with Method('liveness'):
        Description('liveness probe')
        Result(str)
        HTTP(GET, '/liveness')

    with Method('readiness'):
        Description('readiness probe')
        Result(str)
        HTTP(GET, '/readiness')

will generate the below nameko file

from nameko.web.handlers import http


class HttpService:
    name = 'http service'

    @http('GET', '/liveness')
    def liveness(self, request) -> str:
        pass

    @http('GET', '/readiness')
    def readiness(self, request) -> str:
        pass

TODO

  • Configure http url and port
  • Add URL parameter and type
  • Add payload (name, type, description, position etc)
  • Add validation
  • Add gRPC server
  • Generate proto files
  • Generate swagger json

What I want:

with Service('example_service'):
    Title('This is an example service')

    with Method('liveness'):
        Description('liveness probe')
        Result(str)
        HTTP(GET, '/liveness')

    with Method('add'):
        Description('a + b')
        with Payload():                         # Not yet implemented
            Field(1, "a", int, "left operand")  # Not yet implemented
            Field(2, "b", int, "right operand") # Not yet implemented
            Required("a", "b")                  # Not yet implemented
        Result(int)
        HTTP(GET, '/add/{a}/{b}')               # Not yet implemented
        GRPC()                                  # Not yet implemented

Metadata

Release files for nameko-design 0.1.dev2

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

Source distribution (sdist)

Source distribution for nameko-design 0.1.dev2
File Size Uploaded
nameko-design-0.1.dev2.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nameko-design 0.1.dev2
File Interpreter ABI Platform
nameko_design-0.1.dev2-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / nameko-design-0.1.dev2.tar.gz

Download URL nameko-design-0.1.dev2.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9b83ddc9eebcc2f2ca35fb9a9b0267708b1f2d3cc459b815a60d347fa34a0837
BLAKE2b-256 checksum
How to use checksums
c387ba59e70eabdd70507e6cb1479c98b5885ca2bb0f0fb4266931d1ff10ce42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.12 CPython/3.6.0 Darwin/18.7.0

Release files / nameko_design-0.1.dev2-py3-none-any.whl

Download URL nameko_design-0.1.dev2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2843d6aa10fd18fcdc14063458b8bea33ffe6f6165cdb68f72082024f9dc4439
BLAKE2b-256 checksum
How to use checksums
ed74db5197beb8d1462cc54adbb701bc4f3037ac174edba5bc658fcecf388fe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.12 CPython/3.6.0 Darwin/18.7.0

Release history Release notifications | RSS feed

This release

0.1.dev2 This release

2 release files

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