Skip to main content

ASF Scaffold

PyPI version Python

ASF (AI Service Framework) 开发脚手架 —— 一键创建、列表、校验 SU (Service Unit) 模块。

开箱即用,无需克隆仓库或本地构建,pip 安装即可使用,模板文件已打包在 wheel 中。

安装

pip install asf-scaffold

依赖

  • Python >= 3.8
  • click >= 8.0
  • jinja2 >= 3.0

命令一览

命令 说明 示例
asf create <category> <name> 创建新 SU 模块 asf create ai my_service
asf list [category] 列出所有 SU(扫描文件系统) asf list / asf list ai
asf validate <category> <name> 校验 SU 结构 asf validate ai sample

使用流程

1. 创建新 SU 模块

# 创建
asf create ai my_service

# 强制覆盖已存在的模块
asf create ai my_service --force

CLI 不会修改 modules.conf,需手动注册。

创建后自动生成以下文件结构:

server/app/ai/my_service/
├── __init__.py           # APIRouter 聚合
├── api.py                # API 端点
├── README.md             # 模块文档
├── requirements.txt      # Python 依赖
├── Dockerfile            # 容器构建
├── docker-compose.yml    # 容器编排
├── logger.yaml           # 日志配置
├── errors/
│   ├── __init__.py
│   └── error_codes.py    # 错误码定义
└── nginx/
    └── default.conf      # Nginx 反向代理

2. 查看已有模块

# 列出所有(扫描 server/app/ 文件系统)
asf list

# 按分类过滤
asf list ai

# 详细信息(含关键文件校验)
asf list --detail

3. 校验模块结构

asf validate ai my_service

# 自动补全缺失文件
asf validate ai my_service --repair

模板变量

模板使用 Jinja2 语法渲染,可用变量:

变量 示例值 (ai/my_service)
{{category}} ai
{{name}} my_service
{{class_name}} AiMyService
{{error_prefix}} AI_MY_SERVICE
{{category_title}} Ai
{{name_title}} MyService
{{log_path}} logs/ai/my_service/my_service.log
{{image_tag}} registry.inspures.com/ai_su/my_service:latest

许可证

MIT License

Metadata

Release files for asf-scaffold 0.1.1

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

Source distribution (sdist)

Source distribution for asf-scaffold 0.1.1
File Size Uploaded Provenance
asf_scaffold-0.1.1.tar.gz 11.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for asf-scaffold 0.1.1
File Interpreter ABI Platform
asf_scaffold-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / asf_scaffold-0.1.1.tar.gz

Download URL asf_scaffold-0.1.1.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a1115b132b7ff310a85bd1869f3e165ffde395bf95d14903c1d3c030c8d50b9e
BLAKE2b-256 checksum
How to use checksums
034e15cb4c184fe1787079959498c1c05477616fbdc1215e72fcbc48efbb03d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / asf_scaffold-0.1.1-py3-none-any.whl

Download URL asf_scaffold-0.1.1-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
405e8a162cbdad61b0c951e46e5b3b44a7c57ab083bfd6c2ef8d20c8427ae2a2
BLAKE2b-256 checksum
How to use checksums
52dedf8cb43643d7bde2152e4af550e30c43a418f48d2811f8a01ea47f3ee07f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for asf-scaffold 0.1.1

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

0.1.1 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