60% Less Boilerplate
Clean, concise syntax without sacrificing power. Write less code while maintaining full type safety and validation.
See the difference in syntax and discover how Tyck works seamlessly with Pydantic.
Verbose class-based definitions with Field descriptors
from pydantic import BaseModel, Field
from typing import Optional, List
from email_validator import EmailStr
class User(BaseModel):
id: int = Field(gt=0, description="User ID")
name: str = Field(min_length=1, max_length=100)
email: EmailStr = Field(description="User email")
age: Optional[int] = Field(None, gt=0, lt=150)
tags: List[str] = Field(default_factory=list, max_length=10)
# Create instance
user = User(id=1, name="John", email="john@example.com")
print(user.model_dump())Concise functional syntax with chainable validators
from Tyck import interface, String, Integer, Array, Optional
User = interface({
'id': Integer.positive(),
'name': String.min(1).max(100),
'email': String.email(),
'age': Optional(Integer.range(0, 150)),
'tags': Array(String).max(10)
})
# Create instance
user = User(id=1, name="John", email="john@example.com")
print(user.model_dump())Choose the style that fits your project. Both approaches offer the same powerful validation features.
Quick and concise schema definitions using the interface() function. Perfect for simple data validation, API responses, and configuration objects.
from Tyck import interface, String, Number, Integer, Array, Optional, config
# Quick functional schema definition
User = interface({
'id': Integer.positive(),
'name': String.min(1).max(100),
'email': String.email(),
'age': Optional(Number.gt(0).lt(150)),
'tags': Array(String).max(10),
})
# With configuration
StrictUser = interface({
'name': String,
'email': String.email(),
}, config=config(
strict=True,
frozen=True,
extra='forbid',
))
# Create instance
user = User(id=1, name="John", email="john@example.com")
print(user.model_dump())Full-featured classes with the @model() decorator. Add custom methods, inheritance, and more for complex domain models.
from Tyck import model, String, Number, Integer, Array, Optional
@model()
class User:
id: Integer.positive()
name: String.min(1).max(100)
email: String.email()
age: Optional(Number.gt(0).lt(150))
tags: Array(String).max(10)
def greet(self) -> str:
return f"Hello, {self.name}!"
# Create instance
user = User(id=1, name="John", email="john@example.com")
print(user.greet()) # "Hello, John!"
# Inheritance support
@model()
class Admin(User):
role: String.default("admin")
permissions: Array(String)Tyck enhances your Pydantic workflow with cleaner syntax and powerful utilities
Clean, concise syntax without sacrificing power. Write less code while maintaining full type safety and validation.
Built on Pydantic v2, works seamlessly with existing code. No migration headaches, just drop in and start using.
Choose functional (interface) or class-based (@model) as needed. Use what fits your style and project requirements.
pick, omit, partial, extend, merge for schema composition. Transform and combine schemas with familiar patterns.
If you know Pydantic, you already know Tyck. Same concepts, same patterns, just simpler syntax.
Everything you need for Python data validation
Minimal overhead over Pydantic v2. Define schemas in seconds with fluent method chaining.
No classes, no decorators for simple schemas. Define validation with readable dictionaries.
Full type inference and IDE autocomplete. Catch validation errors before runtime.
Built on Pydantic v2. Mix Tyck and Pydantic models seamlessly in the same project.
TypeScript-inspired utilities: pick, omit, partial, extend, merge for schema transformations.
Start using Tyck today alongside existing Pydantic code. No migration required.
Choose the right approach based on your project requirements and complexity.
Best for lightweight, functional validation
Best for complex, customizable models
Best for flexible, mixed-complexity projects
Everything you need to know about Tyck.
Have questions or feedback? We'd love to hear from you.