TuskLang Logo PNT

TuskLang for
Python

Build intelligent configurations for Python applications. Query databases, cache results, and optimize performance directly from your config files.

pip
Package Manager
3min
Setup Time
3.8+
Python Version

Why Python Developers Love TuskLang

Replace static YAML and JSON configs with intelligent, data-driven configuration files.

@

@ Operators for Python

Query APIs, databases, and execute Python expressions directly from configuration files using powerful @ operators.

SQLAlchemy

Database Integration

Native SQLAlchemy and Django ORM support. Query your database directly from config files with full Python integration.

ML & Data Science Ready

Perfect for ML pipelines, data science workflows, and AI applications. Native NumPy, Pandas, and scikit-learn support.

Django & Flask Integration

Drop-in integration for Django settings, Flask configuration, and FastAPI applications. Middleware included.

Auto-Reload

Development-friendly auto-reloading. Changes to config files automatically update your Python application.

pytest

pytest Testing

Built-in pytest support with test helpers and fixtures for testing configurations and @ operators.

Pythonic Configuration

Traditional YAML configs are static files. TuskLang configs are intelligent Python-integrated configurations.

  • 🐍 Native Python integration
  • 📊 Live database queries
  • 🤖 ML-powered optimization
  • 🔄 Auto-reload support
  • 📦 PyPI package ready
config.tsk
# Smart Python Configuration
app_name: "MyPythonApp"
debug: @env("DEBUG", False)

# Database with dynamic scaling
database {
    url: @env("DATABASE_URL")
    pool_size: @query("SELECT COUNT(*) FROM active_connections") * 2
    echo: @env("DEBUG", False)
}

# ML model configuration
ml_model {
    type: @learn("best_model_type", "random_forest")
    batch_size: @optimize("batch_size", 32)
    epochs: @cache("1h", @query("SELECT optimal_epochs FROM model_performance"))
}

# Feature flags based on user data
features: @query("SELECT name FROM features WHERE active = true")

Python Ecosystem Integration

Works seamlessly with your favorite Python frameworks and libraries

Django

Settings integration

Flask

Configuration loader

FastAPI

Async configuration

SQLAlchemy

ORM integration

Pandas

Data science configs

scikit-learn

ML pipeline configs

Get Started in Minutes

Install TuskLang for Python and start building intelligent configurations

1 Install via pip

pip install tusklang

2 Create your configuration

# config.tsk
app_name: "MyPythonApp"
debug: @env("DEBUG", False)

3 Load in your Python app

import tusklang
config = tusklang.load("config.tsk")
Complete Guide View Examples