Skip to main content

A high-performance web framework with elegant syntax and powerful validation using satya

Project description

Tatsat

A high-performance web framework with elegant syntax and powerful validation, built on Starlette and using satya for data validation.

Features

  • Modern: Built on top of Starlette, a lightweight ASGI framework
  • Fast: Utilizes satya's high-performance validation engine
  • Developer-friendly: Intuitive, FastAPI-like syntax for rapid development
  • Type-safe: Leverages Python type hints with satya models
  • Automatic API documentation: Swagger UI and ReDoc integration

Installation

# First install the framework
pip install -e .

# Make sure you have satya installed (or in your project directory)
# pip install satya

Quick Start

Here's a minimal example to get you started:

from tatsat import Tatsat
from src.satya import Model, Field
from typing import List, Optional

app = Tatsat(title="Tatsat Demo")

# Define your data models with satya
class Item(Model):
    name: str = Field()
    description: Optional[str] = Field(required=False)
    price: float = Field(gt=0)
    tax: Optional[float] = Field(required=False)
    tags: List[str] = Field(default=[])

# Create API endpoints with typed parameters
@app.get("/")
def read_root():
    return {"Hello": "World"}

@app.get("/items/{item_id}")
def read_item(item_id: int, q: Optional[str] = None):
    return {"item_id": item_id, "q": q}

@app.post("/items/", response_model=Item)
def create_item(item: Item):
    return item

# Run the application with Uvicorn
if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)

API Documentation

Tatsat automatically generates interactive API documentation using Swagger UI and ReDoc. Access them at /docs and /redoc respectively after starting your application.

Dependencies

Tatsat depends on the following packages:

  • starlette
  • uvicorn
  • satya (for data validation)

License

MIT License

Project details


Download files

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

Source Distribution

tatsat-0.1.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

tatsat-0.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file tatsat-0.1.0.tar.gz.

File metadata

  • Download URL: tatsat-0.1.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for tatsat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d910aa744fe9da5e012b001e7e2fec79e784ec60cc3b58cb30cd060f5d6b34b2
MD5 2b9ad2ee274c4aa30d6058b3803eb834
BLAKE2b-256 148ac26bdb17ffb486f3185b86ea3323931e97f683903cebef3b3577821715ee

See more details on using hashes here.

File details

Details for the file tatsat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tatsat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for tatsat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3db5c3295280f9965acef9888df736785a3cc3ecca363cbf816e1d512ff18e6f
MD5 cab4c722eefca7ed1e908fcfa67659a1
BLAKE2b-256 0daf74d4b8c89565beb37c45e5ca90e3fe25476b9fb267d64aabaa6775b821ad

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