Skip to main content

a micro server

Project description

Simple-Starlette

License License License License License

python微服务框架:

  • 高性能 : asyncio + Uvicorn 高性能异步非阻塞io,事件循环,多路监听
  • 可读性 : 请求与视图解耦,视图与Service解耦,文档与业务解耦
  • 开发耗时: 多种基础工具和中间件,类似flask的开发体验

安装使用

1, 使用 pip 直接安装

pip install simple-starlette

2, 源码安装

git clone https://github.com/mapyJJJ/simple-starlette.git
cd simple-starlette
python3 setup.py install

hello world:

from simple_starlette.args import QueryParams
from simple_starlette import SimpleStarlette, Request
from simple_starlette.responses import Response, ResTypeEnum

app = SimpleStarlette(__name__)

@app.route("/test")
class Index:
    class SomeQuery(QueryParams):
        arg1: int
        arg2: int

    async def get(self, request: Request, q: SomeQuery):  # 定义一个get请求
        return Response({"arg1": q.arg1, "arg2": q.arg2}, ResTypeEnum.JSON) # 构造返回json字符串

if __name__ == "__main__":
    app.run()

# 测试请求
# curl http://localhost:9091/test?arg1=hello&arg2=world
# response:
# {"arg1":"hello", "arg2":"world"}

查看更多开发使用实例:example usage


关于框架:
目的是整合业界常用的技术选型与各种解决方案的封装,在保证框架稳定性与高性能的前提下,提供快速开发与部署后端项目的能力 todo:todo



LICENSE

GPL-3.0 License


Project details


Download files

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

Source Distribution

simple_starlette-2.3.2.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

simple_starlette-2.3.2-py3-none-any.whl (60.8 kB view details)

Uploaded Python 3

File details

Details for the file simple_starlette-2.3.2.tar.gz.

File metadata

  • Download URL: simple_starlette-2.3.2.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.11 CPython/3.10.6

File hashes

Hashes for simple_starlette-2.3.2.tar.gz
Algorithm Hash digest
SHA256 34f2167ec7e33db6456611707343da653ba81e2162dd16be9ed0a6b99f34bf6b
MD5 2ab90e4c73020da1705f6e0268c58684
BLAKE2b-256 81bd0928936df9126744c0da0a67bf4c4829efe913af880c0549289101b81603

See more details on using hashes here.

File details

Details for the file simple_starlette-2.3.2-py3-none-any.whl.

File metadata

  • Download URL: simple_starlette-2.3.2-py3-none-any.whl
  • Upload date:
  • Size: 60.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.11 CPython/3.10.6

File hashes

Hashes for simple_starlette-2.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5d663d423986e50e6d09da0f6c127bfd324f4b988a0e73106ebd1ac73f86738f
MD5 13581e00c0e9c202bb3d0093e01de85d
BLAKE2b-256 975637abc84e6f47a46f7365bebad748df11daa022cc05823aaa08d5200e1716

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page