Skip to main content

A python library

Project description

Schema Transpose

This library and CLI converts JSON Schema Documents into other languages. It can work with JSON Schema or Pydantic files as a source.

Usage

This needs to be installed in the same virtual environment as the Models that it is converting. Once installed a CLI tool, schema_transpose, will be available in the environment.

For example, to generate a variables file for the RDS ParameterValidation class-

robert@Roberts-MacBook-Pro terraform-aws-core % schema_transpose modules.rds.validation.parameters:ParameterValidation

The command will output the following to stdout:

variable "type" {
  type = string
  default = null
}

variable "pit_identifier" {
  type = string
  default = null
}

variable "tags" {
  type = map(any)
  default = {}
}

variable "name" {
  type = string
  validation {
    # Automatically Generated from Rule: minlength
    condition     = length(var.name) >= 1
    error_message = "Field should not be less than 1 characters"
  }
  validation {
    # Automatically Generated from Rule: maxlength
    condition     = length(var.name) <= 63
    error_message = "Field should not be larger than 63 characters"
  }
  validation {
    # Automatically Generated from Rule: pattern
    condition     = length(regexall("^(?!.*--)[a-zA-Z][A-Za-z0-9.-]+(?<!-)$", var.name)) > 0
    error_message = "Field does not match regex pattern ^(?!.*--)[a-zA-Z][A-Za-z0-9.-]+(?<!-)$"
  }
}

variable "vpc_name" {
  type = string
}

variable "engine" {
  type = string
  validation {
    # Automatically Generated from Rule: minlength
    condition     = length(var.engine) >= 1
    error_message = "Field should not be less than 1 characters"
  }
}

variable "engine_version" {
  type = string
  validation {
    # Automatically Generated from Rule: minlength
    condition     = length(var.engine_version) >= 1
    error_message = "Field should not be less than 1 characters"
  }
}

variable "is_public" {
  type = bool
  default = false
}

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

schema_transpose-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

schema_transpose-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file schema_transpose-0.1.0.tar.gz.

File metadata

  • Download URL: schema_transpose-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for schema_transpose-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b8b1f081e8dbcae27aee74c87526a1a8cc0a845e7c78c56d6a049814170e013e
MD5 6237fc71f1b449068076506bd190cb05
BLAKE2b-256 fc564126f6128709e21c1050c531b5a4757f637953be9c11af925227b09453a1

See more details on using hashes here.

File details

Details for the file schema_transpose-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for schema_transpose-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb335dc676b70f233180de00365f185796fc1333deefdccab15a1afc702049da
MD5 c9d608231c3339713ae6ba65ed206c73
BLAKE2b-256 e4147fb4b0be79faf72b3901eab58a3ead131486b5cdfa1f9d70ad9f9d00f9eb

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