Skip to main content

Sample image

aiosox: repo link

Quick example

can be installed using pip/poetry:

poetry shell
 
poetry run uvicorn example:app --port=8001
from typing import List

from fastapi import FastAPI
from pydantic import BaseModel

from aiosox import SioAuth, SioNamespace, SocketIoServer


def get_app():
    applitcation = FastAPI(title="tester")
    return applitcation


app = get_app()

sio_server: SocketIoServer = SocketIoServer(app=app, kafka_url="localhost:29092")
user_namespapce: SioNamespace = SioNamespace("/user", socket_io_server=sio_server)
sio_server._sio.register_namespace(user_namespapce)


@app.on_event("startup")
async def on_start():
    await sio_server.start()


@app.on_event("shutdown")
async def on_shutdown():
    await sio_server.shutdown()


class UserY(BaseModel):
    name: str


class UserT(BaseModel):
    name: str
    what: List[UserY]


class OfferT(BaseModel):
    title: str


on_failed_emmiter = user_namespapce.create_emitter("failed", model=OfferT | UserT)


@user_namespapce.on(
    "submit",
    description="when user submits a form",
    payload_model=UserT | UserY,
    response_model=List[UserT],
    auth=SioAuth.jwt,
)
async def on_submit(sid, data):
    print(
        sid,
        data,
    )

Metadata

Release files for aiosox 0.3.0

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

Source distribution (sdist)

Source distribution for aiosox 0.3.0
File Size Uploaded Provenance
aiosox-0.3.0.tar.gz 19.1 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 46.3 kB

Release files / aiosox-0.3.0.tar.gz

Download URL aiosox-0.3.0.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3ec444bd9e09ca392b9fafb3af5b4f3caeb4e58cef1ef297e710f5a84fab5a83
BLAKE2b-256 checksum
How to use checksums
53662fdbc5fafa73d399d80e2df4357831ff5534781b42e2c340d56baa0835c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.0 Darwin/22.1.0

Release files / aiosox-0.3.0-py3-none-any.whl

Download URL aiosox-0.3.0-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ed8afe9d20dcf7796f2d55f29a3be0d686a78ede239a25dc324f2f322378211
BLAKE2b-256 checksum
How to use checksums
766ab58d18b1fb8f8f796aef9fc2cc93757ccc068fa9d62aace2b3275dbc115f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.0 Darwin/22.1.0

Security for aiosox 0.3.0

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