Skip to main content
Pre-release

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

Slinn

Slinn - универсальная сетевая платформа на Python
Tests Supported Python versions GitHub Release GitHub Repo stars

Документация: https://openmiot.github.io/slinn/

Исходный код: https://github.com/OpenMiot/slinn/


Преимущества Slinn

  • Асинхронность + параллелизм(только во Free-Threaded Python)
  • Поддержка плагинов и пакетный менеджер
  • Гибкая декларативная настройка
  • Поддержка любых сетевых протоколов
  • Работа на нескольких портах в одном запущенном экземпляре

Простой пример синтаксиса

from slinn.net.http import HttpRouter
from slinn.net.http.responses import HttpRedirect
from slinn.net.http.filters import AnyFilter
from slinn.net.address import Address


router = HttpRouter()


@router.get('api/<str method>')
async def api(client_address: Address, method: str):
    return {
        'status': 'ok',
        'method': method,
        'ip': client_address.host
    }

@router.get()
@router.get('index')
async def index():
    return HttpRedirect('/helloworld')


@router(AnyFilter)
async def helloworld():
    return 'Hello world!'

Начало проекта

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

Вставьте пример в localhost/app.py, затем запустите скрипт start.bat или start.sh

Для настройки проекта нужно редактировать конфиг slinn.toml

Для настройки приложения нужно редактировать %app%/config.toml

Зависимости

  • Python 3.15 и выше (желательно без GIL)
  • tomlkit - управление конфигами
  • orjson - более быстрая работы с json
  • babel - локализация фреймворка
  • pydantic - валидация конфигов

Опциональные зависимости

Средства разработки фреймворка (dev):
  • pytest - тестирование фреймворка
  • pytest-asyncio - тестирование асинхнронных функций
  • pytest-describe - группировка тестов
  • pytest-mock - более удобное создание моков
  • pytest-cov - подсчет покрытия тестами
  • taskipy - упрощение ввода команд
  • poetry - сборка и публикация пакета на PyPI
  • zensical - документация
Асинхронные событийные циклы, которые могут улучшить производительность (alt_loop):
  • winloop - альтернативный асинхронный событийный цикл на Windows
  • uvloop - альтернативный асинхронный событийный цикл на Linux/MacOS

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slinn-3.0.0a11.tar.gz (680.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slinn-3.0.0a11-cp315-cp315-win_amd64.whl (381.1 kB view details)

Uploaded CPython 3.15Windows x86-64

File details

Details for the file slinn-3.0.0a11.tar.gz.

File metadata

  • Download URL: slinn-3.0.0a11.tar.gz
  • Upload date:
  • Size: 680.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.15.0b4 Windows/11

File hashes

Hashes for slinn-3.0.0a11.tar.gz
Algorithm Hash digest
SHA256 2d93b3d0255329271f8b8c5f3c4bd7c9d7e50612d309b2d2dd995cab0d927efc
MD5 01b702f31b1edeb79a68785cadbe2d55
BLAKE2b-256 bdd001e0f2ec4b39fa3727981aab9f131c0253a5c73e67f2f6dffedab09e8ad8

See more details on using hashes here.

File details

Details for the file slinn-3.0.0a11-cp315-cp315-win_amd64.whl.

File metadata

  • Download URL: slinn-3.0.0a11-cp315-cp315-win_amd64.whl
  • Upload date:
  • Size: 381.1 kB
  • Tags: CPython 3.15, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.15.0b4 Windows/11

File hashes

Hashes for slinn-3.0.0a11-cp315-cp315-win_amd64.whl
Algorithm Hash digest
SHA256 4afd8d59606483508879ff695599fb0407500379b138c36ca153d52f9461b558
MD5 47c8d1e6b1ebba62590406ce9bc857b3
BLAKE2b-256 e3b8fdeb82416a754d5de0a39f8d2c853f713c48282e406e38ff91466c2ab29e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.0.0a11 This release

2 files

2.3.10

2 files

2.3.9

2 files

2.3.8

2 files

2.3.7

2 files

2.3.6

2 files

2.3.5

2 files

2.2.15

1 file

2.2.14

1 file

2.2.13

1 file

2.2.12

1 file

2.2.11

1 file

2.2.10

1 file

2.2.9

1 file

2.2.8

1 file

2.2.7

1 file

2.2.6

1 file

2.2.5

1 file

2.2.4

1 file

2.2.3

1 file

2.2.2

1 file

2.2.0

1 file

2.1.2

1 file

2.1.1

1 file

2.1.0

1 file

2.0.1

1 file

2.0.0

1 file

1.2.1

1 file

1.2.0

1 file

1.1.7

1 file

1.1.6

1 file

1.1.5

1 file

1.1.4

1 file

1.1.3

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.0

1 file

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