Hex build

skir_client

skir_client is the runtime library for Gleam code generated by Skir.

What is Skir?

Skir is a declarative language for defining data types, constants, and APIs. Write your schema once in a .skir file and generate idiomatic, type-safe code in 12+ languages including Gleam, Python, Rust, Go, and more.

Key features

Installation

gleam add skir_client

Quick example

import skir_client
import skirout/user
import gleam/io

// Construct a User
let john = user.user_new(
  user_id: 42,
  name: "John Doe",
  quote: "Coffee is just a socially acceptable form of rage.",
  pets: [user.user__pet_new(1.0, "Dumbo", "🐘")],
  subscription_status: user.SubscriptionStatusFree,
)

// Serialize to JSON
let serializer = user.user_serializer()
let john_json = skir_client.to_readable_json_code(serializer, john)
io.println(john_json)

// Deserialize from JSON
let assert Ok(restored) = skir_client.from_json_code(serializer, john_json)

Learn more

Search Document