Skip to main content

A narrow DSL that compiles structured-output contracts to strict JSON Schema.

Project description

Blueprint DSL

Blueprint is a small language for declaring the exact JSON object an AI model must return. It compiles to strict JSON Schema and fails with line-oriented diagnostics when a contract is invalid or exceeds common structured-output provider limits.

Schema Friend:
  name: String(min=1)
  closeness: Float(min=0.0, max=1.0)

Return Person:
  name: String(min=1)
  age: Optional[Integer]
  address:
    street: String
    city: String
  tags: List[String]
  status: Enum["draft", "final"]
  friends: List[Friend]
from blueprint_dsl import compile_blueprint

compiled = compile_blueprint(source)
print(compiled.name)
print(compiled.schema)

Language

A Blueprint contains exactly one Return Name: declaration and may contain reusable Schema Name: declarations. Every declared field is required. Optional[T] means the field value may be null; it does not make the field absent.

Supported primitives are String, Integer, Float, and Boolean. None is available for nullable unions. Formatted strings include Date, Time, Datetime, Duration, Email, Hostname, IPv4, IPv6, and Uuid. Containers include List[T], Enum[...], Optional[T], and unions such as String | None.

String and formatted-string min/max arguments constrain length. Numeric types support min, max, exclusive_min, exclusive_max, and multiple_of. Lists support min and max item counts. Two-space-indented bare fields create inline objects; List: creates an inline list of objects. Trailing comments become schema descriptions.

blueprint_spec_card() returns the complete compact language reference used by Blueprint editors. blueprint_editor_metadata() and blueprint_types_by_category() expose the same canonical type registry for UI tooling.

Stability

Blueprint is intentionally narrow and feature complete. Version 0.1.0 establishes the public package API and blueprint/1 language semantics. Future releases are expected to be bug fixes unless an actual language defect requires a documented change.

Development

Blueprint supports Python 3.12 through 3.14 and has no runtime dependencies.

./gate.sh

The gate runs linting, static analysis, the complete compiler suite with branch coverage, and a distribution build. PyPI publication is a separate, deliberate release action.

License

MIT

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

blueprint_dsl-0.1.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

blueprint_dsl-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blueprint_dsl-0.1.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for blueprint_dsl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0a853e52c6266699c39368dbb0795712821a7c7400c244720b473c967d7181cc
MD5 41cf847d7f537de948a45e6e32c977c7
BLAKE2b-256 b5a5de2592d739223fafb4c42abd0e7cf1efc6f5b2ab378e8b85dca68df3bd55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blueprint_dsl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for blueprint_dsl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03a21d2f9aea714a873ccfb70d0f794e5685b56f23329526d7bb057854739cc5
MD5 20b4c49f7ef9317338a749e41be04658
BLAKE2b-256 a213b87c415025c1020b87313c691323bc15a9b6911e663140b18dbc1f1abd4e

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