Skip to main content

Rainbow Common Schema

Project description

rb_schemas 사용 설명서

rb_schemas는 프로젝트 공통 Pydantic 스키마와 Flow Manager 연동 타입을 제공하는 패키지입니다.

1. 제공 구성

  • 기본 스키마 (base.py)
    • Response_ReturnValuePD
    • NJointfPD, NInputfPD, Vec3fPD 등 공용 모델
  • Flow Manager 연계 타입 (sdk.py)
    • FlowManagerArgs
  • 스키마 유틸 (utility.py)
    • Pick(base, *include)
    • Omit(base, *omit)
  • FBS 기반 자동 생성 모델
    • rb_schemas.fbs_models.*
    • 클래스명은 ...PD 접미사 규칙

2. FlowManagerArgs 용도

FlowManagerArgs는 SDK 함수에서 Flow Manager 실행 컨텍스트를 받을 때 사용합니다.

from rb_schemas.sdk import FlowManagerArgs

def my_step_handler(flow_manager_args: FlowManagerArgs | None = None):
    # step 로직 수행
    if flow_manager_args is not None:
        flow_manager_args.done()

3. Pick/Omit 사용 예제

from pydantic import BaseModel
from rb_schemas.utility import Omit, Pick

class UserPD(BaseModel):
    user_id: str
    email: str
    password: str

UserPublicPD = Omit(UserPD, "password")
UserOnlyIdPD = Pick(UserPD, "user_id")

4. FBS 모델 사용 예제

# 예: 자동 생성된 모델 import
from rb_schemas.fbs_models.nexus.v1.deploy_models import Response_Deploy_ProgressPD

payload = Response_Deploy_ProgressPD(
    sw_name="example",
    ip="127.0.0.1",
    mode="dev",
    tag="v1",
    percentage=80,
    service_name="manipulate",
    result="success",
)

5. 참고

  • FBS 기반 모델은 backend.flatc 실행 시 자동 재생성됩니다.
  • 생성 모델은 snake_case 필드와 alias(원본 CamelCase)를 함께 가질 수 있습니다.

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

rainbow_rb_schemas-0.0.9.dev31.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

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

rainbow_rb_schemas-0.0.9.dev31-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file rainbow_rb_schemas-0.0.9.dev31.tar.gz.

File metadata

File hashes

Hashes for rainbow_rb_schemas-0.0.9.dev31.tar.gz
Algorithm Hash digest
SHA256 7f32d25fbdfd6fd1deaf7d764343457e6d3017e8c6ad192a31a632a0398440f3
MD5 631e3caab2750b94caf7fde8114af8b8
BLAKE2b-256 3c60ec6371040a78b79a53ad952ca4a2a3f19076bf8e15e2ba90343a1e021e6e

See more details on using hashes here.

File details

Details for the file rainbow_rb_schemas-0.0.9.dev31-py3-none-any.whl.

File metadata

File hashes

Hashes for rainbow_rb_schemas-0.0.9.dev31-py3-none-any.whl
Algorithm Hash digest
SHA256 061013313a6862f71e40f513e3e6936a29d2a436464d319c7c6a4b6a5f6c7c7c
MD5 d70c6cd69caa4e7c0241b8fa8d866d20
BLAKE2b-256 3075ac17d33fa56813804b4a0c776e9b23fe14bd0b8893103db1185441809a12

See more details on using hashes here.

Supported by

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