Skip to main content

Slinn

Slinn is an HTTP server framework
License GitHub top language GitHub Release GitHub Repo stars

Simple example

from slinn import (
    ApiDispatcher, AnyFilter, AsyncRequest, HttpResponse,
    HttpRedirect, HttpJSONResponse
)


dp = ApiDispatcher()


@dp.get('api/<str method>')
async def api(request: AsyncRequest, method: str) -> HttpResponse:
    return HttpJSONResponse(
        status='ok',
        method=method,
        ip=request.ip
    )

@dp.get()
@dp.get('index')
async def index() -> HttpResponse:
    return HttpRedirect('/helloworld')


@dp(AnyFilter)
async def helloworld() -> HttpResponse:
     return HttpResponse('Hello world!')

Begin project

Standart

slinn-admin create-project www
cd www
venv/bin/activate
slinn create-app localhost host=localhost host=127.0.0.1

Insert example into localhost/app.py file, then run start.bat or start.sh script

Expected output

Loading config...
Apps: firstrun
Debug mode enabled
Smart navigation enabled

Starting server...
HTTP server is available on http://localhost:8080/

To config project you should edit ./project.json

To config app you should edit ./%app%/config.json

Classic

Unix-like (Linux, MacOS, FreeBSD...):
mkdir helloworld 
cd helloworld
python3 -m venv venv
venv/bin/activate
Windows:
mkdir helloworld 
cd helloworld
python3 -m venv venv
venv\Scripts\activate

Insert example into ./example.py and add following code:

from slinn import AsyncServer
import asyncio
asyncio.run(AsyncServer(dp).listen(Address(8080)))

then write python example.py

Expected output

helloworld $ venv/bin/python example.py
HTTP server is available on http://localhost:8080/

Metadata

Release files for slinn 2.3.10

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

Source distribution (sdist)

Source distribution for slinn 2.3.10
File Size Uploaded Provenance Actions
slinn-2.3.10.tar.gz 89.8 kB Without provenance Details for slinn-2.3.10.tar.gz

Built distribution (wheel)

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

Total release size: 241.8 kB

Release files / slinn-2.3.10.tar.gz

Download URL slinn-2.3.10.tar.gz
Size 89.8 kB
Tags Source
SHA-256 checksum
How to use checksums
91bd2e741a25cbc4aede1aa34d1945b05e20a7d17fd55e5cf657edc86dac47ed
BLAKE2b-256 checksum
How to use checksums
8d19da5e488e6b55d51448d7da75b313cef2599ee1ed65a540c5eb180e66a35c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.15.0b4 Windows/11

Release files / slinn-2.3.10-py3-none-any.whl

Download URL slinn-2.3.10-py3-none-any.whl
Size 152.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41f2adcf376f2a53a559b78c0bbc62d33e7f6f00878ad3ede212e508dd0586f8
BLAKE2b-256 checksum
How to use checksums
67948131df37022891626496447fe8b2b57d0b9c93b1b7e1357219bfd92cf339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.15.0b4 Windows/11

Security for slinn 2.3.10

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.

Release history Release notifications | RSS feed

This release

2.3.10 This release

2 release files No provenance

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