vovk-hello-world

vovk_hello_world v0.0.45 Checked with mypy Vovk.ts

A showcase for Next.js + Vovk.ts + Zod, demonstrating its capabilities with TypeScript, Rust, and Python RPC.

License: MIT

# Install the package
pip install vovk_hello_world

UserRPC

UserRPC.update_user

POST https://vovk-hello-world.vercel.app/api/users/{id}

from vovk_hello_world import UserRPC

response = UserRPC.update_user(
    body={
        # User email
        "email": "john@example.com",
        # User profile object
        "profile": {
            # User full name
            "name": "John Doe",
            # User age
            "age": 25
        }
    },
    query={
        # Notification type
        "notify": "email"
    },
    params={
        # User ID
        "id": "123e4567-e89b-12d3-a456-426614174000"
    },
)

print(response)
{
    # -----
    # Response object
    # -----
    # Success status
    "success": true
}

StreamRPC

StreamRPC.stream_tokens

GET https://vovk-hello-world.vercel.app/api/streams/tokens

from vovk_hello_world import StreamRPC

response = StreamRPC.stream_tokens()

for i, item in enumerate(response):
    print(f"iteration #{i}:\n {item}")
    # iteration #0:
    {
        # Message from the token
        "message": "string"
    }

OpenApiRPC

OpenApiRPC.get_spec

GET https://vovk-hello-world.vercel.app/api/static/openapi/spec.json

from vovk_hello_world import OpenApiRPC

response = OpenApiRPC.get_spec()