Skip to main content

Write types once, use everywhere

Project description

SyncLangs

One centralized types file -> Multiple languages across all your codebases.

PyPI version Python versions License: Proprietary

SyncLangs is a developer tool that enables you to maintain a single source of truth for your type definitions. Define your structures once in a universal schema language (.syln) and automatically synchronize them as native, idiomatic types across Python, TypeScript, and multiple projects or packages simultaneously.

Why SyncLangs?

Modern full-stack applications often use different languages for frontend (TypeScript) and backend (Python). This creates type duplication, drift risk, and maintenance burden.

SyncLangs solves this by:

  • No more type drift - Define types once, generate native code for each language
  • Zero config start - Works immediately with sensible defaults
  • Fast watch mode - Regenerates in under 200ms on file save
  • Readable syntax - Human-readable .syln files, no verbose boilerplate

Quick Start

Installation

pip install synclangs
# or
pipx install synclangs

Initialize a Project

syln init

This creates:

  • syln.config.json - Configuration file
  • shared/example.syln - Example schema

Define Your Types

Create shared/user.syln:

## Represents a user in the system
type User {
  ## Unique identifier
  id: string

  ## User's email address
  email: string

  ## Display name (optional)
  name: string?

  ## Account active status
  isActive: bool

  ## User tags
  tags: list<string>

  ## Arbitrary metadata
  metadata: map<string, any>
}

Generate Code

syln generate

TypeScript Output (user.types.ts):

// Auto-generated by SyncLangs - DO NOT EDIT

export interface User {
  /** Unique identifier */
  id: string;
  /** User's email address */
  email: string;
  /** Display name (optional) */
  name?: string;
  /** Account active status */
  isActive: boolean;
  /** User tags */
  tags: string[];
  /** Arbitrary metadata */
  metadata: Record<string, any>;
}

Python Output (user_types.py):

# Auto-generated by SyncLangs - DO NOT EDIT

from dataclasses import dataclass
from typing import Any, Optional

@dataclass
class User:
    """Represents a user in the system"""
    id: str
    """Unique identifier"""
    email: str
    """User's email address"""
    is_active: bool
    """Account active status"""
    tags: list[str]
    """User tags"""
    metadata: dict[str, Any]
    """Arbitrary metadata"""
    name: Optional[str] = None
    """Display name (optional)"""

Watch Mode

syln watch

Changes to .syln files automatically regenerate output in under 200ms.

CLI Reference

Command Description
syln init Initialize a new project with config and example
syln generate Generate code from .syln files
syln check Validate schemas without generating
syln watch Watch mode with auto-regeneration
syln version Show version

Common Flags

Flag Short Description
--config -c Config file path (default: ./syln.config.json)
--input -i Input directory (default: ./shared)
--out-ts TypeScript output directory
--out-py Python output directory
--verbose -v Verbose logging
--dry-run Show what would be generated

Syntax Reference

Primitives

SyncLangs Python TypeScript
string str string
int int number
float float number
bool bool boolean
any Any any

Generics

SyncLangs Python TypeScript
list<T> list[T] T[]
map<K, V> dict[K, V] Record<K, V>

Nullable Types

type Example {
  required: string      # Required field
  optional: string?     # Optional field (nullable)
}

Imports

import { User, Address } from "./user.syln"

type Order {
  user: User
  shippingAddress: Address
}

Comments

# Regular comment (ignored in output)

## Doc comment (generates docstrings/JSDoc)
type User {
  ## The user's unique identifier
  id: string
}

Configuration

Create syln.config.json in your project root:

{
  "$schema": "https://synclangs.com/schema/v1.json",
  "version": "1.0",
  "input": "./shared",
  "outputs": {
    "typescript": {
      "enabled": true,
      "outDir": "./generated/ts",
      "fileExtension": ".types.ts"
    },
    "python": {
      "enabled": true,
      "outDir": "./generated/py",
      "fileExtension": "_types.py",
      "useDataclasses": true
    }
  },
  "options": {
    "watchDebounceMs": 100,
    "caseConversion": {
      "fields": {
        "python": "snake_case",
        "typescript": "camelCase"
      }
    },
    "generateIndex": true
  }
}

Error Messages

SyncLangs provides helpful error messages with file locations and suggestions:

Error: SY002 - Invalid type reference
  --> shared/user.syln:15:12
   |
15 |   role: Roles
   |         ^^^^^ Type 'Roles' not found. Did you mean 'Role'?
   |
Help: Import 'Roles' or define it in this file.

Documentation

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting a PR.

License

Proprietary — © 2025 SyncLangs. All rights reserved. See LICENSE.


Made with care by SyncLangs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

synclangs-0.2.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (17.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

synclangs-0.2.6-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (17.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

synclangs-0.2.6-cp313-cp313-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

synclangs-0.2.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (17.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

synclangs-0.2.6-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (18.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

synclangs-0.2.6-cp312-cp312-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

synclangs-0.2.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (17.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

synclangs-0.2.6-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (18.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

synclangs-0.2.6-cp311-cp311-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

synclangs-0.2.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (16.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

synclangs-0.2.6-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (17.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

synclangs-0.2.6-cp310-cp310-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file synclangs-0.2.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 48e272dd94e1ac94d3db18f81001d2d06b2ab262cf2a3d22f201364ef7926283
MD5 ced2a0573ed66e72ec2e77fcc0f1687e
BLAKE2b-256 336409ec02668d644d39aa3cca7056a354cf4b2be9e43a829be184cfae4e0f63

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2658496b9d1be20fcdc2bd083034b92e6e36fc3b4055d23b77d94a27a501c6c8
MD5 939451b0ebcd424078e6743d4be52f8a
BLAKE2b-256 d2f443a813ec8b4920b2c2584144fb2a3f8c07dfac5e15e3e466e2bb9d67f678

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e93589f13cddfa3657c1160408fc21acd0310a1f553a4f90d09a9338ef2cda0b
MD5 8771ec6fa514bde835c8dd4dfa6f8aba
BLAKE2b-256 19d0d358b034a1f16a17b9d7a3fca4fff4b9ea119b5c0aefdec3c3d8096dbcc2

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5ea9deccdeae1854f9af5e7f237206a81c1229048c58976cc724d9f3cfeb7203
MD5 2ba1eae688b32dfadaf40a8c3213258b
BLAKE2b-256 6e56a1b351024a7f0f0a406d2b0b1409b200d349087e6b1fdba62efdac8da5b9

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c4ae0a9cf93f369cb6da87be373e275585ae8489a8d10330a4b4c503aaaa769f
MD5 d87abdcbf90904a7d28d298ca64c37c8
BLAKE2b-256 59e797828b951dd7bba4159561171b92f4ee4e4aa78f0b2d44b1946b3564fdd7

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eaae3a336751442110df863f7ccad4001d62e1f5fa8e2b0cffa9f7061c56b19d
MD5 759b2d72144feb6ead7038e304eab93d
BLAKE2b-256 eb14c2c973a15e09ff4d95a8e5a29299f415c28d238aa8c97558da1876f57230

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 54361849a28b1fc58d9e3269127a252dcc477e4915be6ef78676fad4c5f2bf1f
MD5 1e5bc8ea0cfa4592c1d56f2f959ace63
BLAKE2b-256 70b58f345064561b0b427d1e4b899d6dd0012d85fdc5620d18fdb0990b1d6971

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 971b87612bb2eadbc179476dd1f888c17265d704c5babcb6185a7a2823af2a4a
MD5 dda9642f3d6ab5f852437f7aeb9502f8
BLAKE2b-256 2ab3a45bbe766135915bb8653391909f370e843c7a324a933d80b2763affd092

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 96c8caeb8a6cd146b6756278a4ab7466ead087b0418fbd3b12a2d40e641a1426
MD5 e55d29ec38be652df7e3e25cf9777da0
BLAKE2b-256 ade1dc5c04cf108b187b9e7eb30503ae4395e9adaeaafe09852aea6f736f6cae

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4162f2a1267a42049e920732a2904860c270cd619a4cb5c687bab9f2e59ca554
MD5 84f68e51f5aeab6635545089efd1e49e
BLAKE2b-256 cadd08a412aa57f4dbebdaa5e79878c0b42043d06bfa3af9aa855cb990ea38b0

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 197e558a367fbba8b9910fc9fb1741862441cddc802f2fe6680af4e86d17e6c4
MD5 2ccdaed3a95dae87701d80b9ff661451
BLAKE2b-256 5e2b5fa51c9e4dc86ad01c31a5a18637eb9ffc276433542b6d1ee71d24f8a1d6

See more details on using hashes here.

File details

Details for the file synclangs-0.2.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for synclangs-0.2.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c606e8be0c66bff153134eb5274d069a6dddf5dcd72ddbeeba5656fdcc8fb6e6
MD5 c836aa78e0fd6923f1eae989ae051c56
BLAKE2b-256 d9d1b1863bf07fec363a1f2235d03b6992f021a85203c75c4ff2cf46f2dcc06b

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