Skip to main content

Seatools Flask Starter

This framework must be used in conjunction with the seatools-starter-server-* packages, using seatools-starter-server-uvicorn as an example here.

中文文档

Usage Guide

  1. Install with poetry add flask seatools-starter-server-uvicorn seatools-starter-web-flask
  2. Configure config/application.yml as follows:
seatools:
  server:
    # Here are the uvicorn parameter configurations
    uvicorn:
      host: 0.0.0.0
      port: 8000
      workers: 1
      reload: true
  # Here are the Flask configurations
  flask:
    # Consistent with Flask parameters
    import_name: seatools.ioc.server.app
    static_folder: static
    template_folder: templates
    ...
  1. Usage, load by defining ioc container functions
import abc
from seatools.ioc import Autowired, Bean
from flask import Flask

# Add route
from flask import Flask

@Bean
def api_controller(app: Flask):
    @app.get('/')
    def hello():
        return 'hello flask'

class Service(abc.ABC):
    
    def hello(self):
        raise NotImplementedError

# Flask integration with seatools ioc injection
@Bean
class ServiceA(Service):

    def hello(self):
        return "serviceA"

@Bean
def a2_router(app: Flask, service: Service):  # Specific injection method see seatools

    @app.get('/service')
    def service():
        return service.hello() # return hello flask
  1. Run, see seatools-starter-server-*, example: seatools-starter-server-uvicorn

Metadata

Release files for seatools-starter-web-flask 1.0.2

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

Source distribution (sdist)

Source distribution for seatools-starter-web-flask 1.0.2
File Size Uploaded Provenance Actions
seatools_starter_web_flask-1.0.2.tar.gz 2.9 kB Without provenance Details for seatools_starter_web_flask-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for seatools-starter-web-flask 1.0.2
File Interpreter ABI Platform Actions
seatools_starter_web_flask-1.0.2-py3-none-any.whl Python 3 none any Details for seatools_starter_web_flask-1.0.2-py3-none-any.whl

Total release size: 6.8 kB

Release files / seatools_starter_web_flask-1.0.2.tar.gz

Download URL seatools_starter_web_flask-1.0.2.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5a411788710cb755cd2a4a41b9c3ffcc7b34f0f175721b3941116f9bc2b0282c
BLAKE2b-256 checksum
How to use checksums
794f1a663426ccaaeba85a0894ce6b4a77df9a5f8feeb0ea96840335b9169ba8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / seatools_starter_web_flask-1.0.2-py3-none-any.whl

Download URL seatools_starter_web_flask-1.0.2-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6a9fbe359823fb90ff2a2e1337861213df141a229e0c22fcd771e6d929acf6e
BLAKE2b-256 checksum
How to use checksums
51b55b9b361203de171d819efedd4dc218f8f071f049cfb058bafc9043e4dc0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for seatools-starter-web-flask 1.0.2

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