dryvPacks

@dryv/python-client-sdkv0.1.0

Async HTTPX client SDK with shared Pydantic models and typed operations.

Python Client SDKClientsUnitPublished 7 days ago2 downloads

dryv pack add @dryv/python-client-sdk
2.4 KBRaw ↗
yaml
version: dryv.pack/v1alpha1
key: unit.clients.python-client-sdk
layout: unit
package:
  name: { $ref: "#/inputs/package_name" }
  import_root: src/dryv_client

source: templates

info:
  title: Python Client SDK
  version: 0.1.0
  description: Generates an async Python 3.11+ HTTPX client with Pydantic models and typed operations.

  purpose: clients
  summary: Async HTTPX client SDK with shared Pydantic models and typed operations.
  languages: [python]
  frameworks: [httpx, pydantic]
  tags: [client, sdk, python, http]

plugins:
  - name: jinja
    extensions: [.j2]

inputs:
  package_name:
    type: string
    default: dryv-client
    description: Distribution name for the generated Python SDK.

selections:
  failures:
    subject: failure
    scope: all
  enums:
    subject: property.enum
    scope: each

  models:
    subject: schema
    scope: each

  generics:
    subject: property.generic
    scope: each

  operations:
    subject: operation
    filter:
      all: { facet: http }
    scope: each

templates:
  failures:
    $ref: "#/selections/failures"
    imports:
      - $ref: "#/templates/model"
  enum:
    $ref: "#/selections/enums"
    output:
      name: $(subject.name.snake)
      symbol: $(subject.name.pascal)

  model:
    $ref: "#/selections/models"
    output:
      name: $(subject.name.snake)
      symbol: $(subject.name.pascal)
    imports:
      - $ref: "#/templates/enum"
      - $ref: "#/templates/model"
      - $ref: "#/templates/generic"

  generic:
    $ref: "#/selections/generics"
    output:
      name: $(subject.name.snake)
      symbol: $(subject.name.pascal)
    imports:
      - $ref: "#/templates/model"
      - $ref: "#/templates/generic"

  operation:
    $ref: "#/selections/operations"
    output:
      name: $(group.name.snake)_$(subject.name.snake)
      symbol: $(group.name.snake)_$(subject.name.snake)
    imports:
      - $ref: "#/templates/model"
      - $ref: "#/templates/enum"
      - $ref: "#/templates/generic"

  models-index:
    exports:
      - $ref: "#/templates/enum"
      - $ref: "#/templates/model"
      - $ref: "#/templates/generic"

  operations-index:
    exports:
      - $ref: "#/templates/operation"

  package-index:
    exports:
      - $ref: "#/templates/models-index"
      - $ref: "#/templates/operations-index"

provides:
  operation.client:
    $ref: "#/templates/operation"
  schema.types:
    $ref: "#/templates/model"
  property.enum.types:
    $ref: "#/templates/enum"