Skip to main content

JSON Type Definition Code Build

PyPI version Testsuite Python version Project Status Supported Interpreters License

jtd-codebuild is a tool for generating language specific schemas and interfaces code from JSON Type Definition IDL files in either yaml or json format.

This tool is built on top of jtd-codegen so check out the documentation if you don't have a clue about JSON Type Definition.

Quick Example

In this example, we will generate Python and TypeScript code from JSON Type Definition IDL files.

First, copy and paste the following configuration file to the root of your project.

{
  "include": [
    "src"
  ],
  "references": [],
  "jtdBundlePath": "gen/schema.jtd.json",
  "targets": [
    {
      "language": "python",
      "path": "gen/python"
    },
    {
      "language": "typescript",
      "path": "gen/typescript"
    }
  ],
  "$schema": "https://raw.githubusercontent.com/01Joseph-Hwang10/jtd-codebuild/master/jtd_codebuild/config/project/config.json"
}

Then, we'll create some JSON Type Definition IDL files in the src directory.

# src/book.jtd.yaml
Book:
  properties:
    id:
      type: string
    title:
      type: string
# src/user.jtd.yaml
User:
  properties:
    id:
      type: string
    name:
      type: string
    books:
      elements:
        ref: Book

Finally, run the following command to generate the code.

jtd-codebuild .

You can find the generated code in the gen directory.

More Examples

You can find more examples under the tests directory:

API Documentation

See the API Documentation for more information.

Contributing

Any contribution is welcome! Check out CONTRIBUTING.md and CODE_OF_CONDUCT.md for more information on how to get started.

License

jtd-codebuild is licensed under a MIT License.

Metadata

Release files for jtd-codebuild 1.0.0

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

Source distribution (sdist)

Source distribution for jtd-codebuild 1.0.0
File Size Uploaded Provenance Actions
jtd_codebuild-1.0.0.tar.gz 19.1 kB Without provenance Details for jtd_codebuild-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jtd-codebuild 1.0.0
File Interpreter ABI Platform Actions
jtd_codebuild-1.0.0-py3-none-any.whl Python 3 none any Details for jtd_codebuild-1.0.0-py3-none-any.whl

Total release size: 54.1 kB

Release files / jtd_codebuild-1.0.0.tar.gz

Download URL jtd_codebuild-1.0.0.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
813baa5dc9f21d9579acac0ece5c78e0a47245be6b674833530c5beec1fcb53e
BLAKE2b-256 checksum
How to use checksums
3c551d312e8450665da680849a241f96dc4fb29bf83d260261337254a34311a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.9 Linux/6.5.0-1018-azure

Release files / jtd_codebuild-1.0.0-py3-none-any.whl

Download URL jtd_codebuild-1.0.0-py3-none-any.whl
Size 35.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d66e8e6501d7fcc86f0760b74521f5ba78e98a84e6f76e7c727ed9aa7a47410
BLAKE2b-256 checksum
How to use checksums
7117a2aa088ecceb6a2b0e11fba6c86593f9fd35770a7084a85595c419361b5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.9 Linux/6.5.0-1018-azure

Security for jtd-codebuild 1.0.0

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.

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