Metadata-Version: 2.4
Name: pyautoschema
Version: 0.1.0
Summary: Automatically generate Pydantic models from dictionaries
Author: Shakhobiddin Bozorov
Author-email: Shakhobiddin Bozorov <bozorovshahob27@gmail.com>
License: Shakhobiddin Bozorov
        
        
        MIT License
        
        Copyright (c) 2025 Shakhobiddin Bozorov
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
Project-URL: Homepage, https://pypi.org/project/pyautoschema/
Project-URL: Repository, https://github.com/Robben1972/pyautoschema
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: license-file
Dynamic: requires-python


# PyAutoSchema

**PyAutoSchema** is a lightweight Python library that automatically generates [Pydantic](https://docs.pydantic.dev/) models from Python dictionaries. It's especially useful for fast prototyping, validating API responses, or converting JSON-like structures into Pydantic schemas.

## 🔧 Features

- Supports nested dictionaries
- Infers list and union types
- Generates clean, human-readable Pydantic classes
- Simple one-line usage

## 📦 Installation

```bash
pip install pyautoschema
```

## 🚀 Usage

```python
from pyautoschema import infer_schema

sample = {
    "id": 123,
    "name": "Alice",
    "tags": ["admin", "user"],
    "profile": {
        "age": 30,
        "active": True
    }
}

infer_schema(sample, output="schemas.py")
```

Output (`schemas.py`):

```python
from typing import List
from pydantic import BaseModel

class Profile(BaseModel):
    age: int
    active: bool

class InferredModel(BaseModel):
    id: int
    name: str
    tags: List[str]
    profile: Profile
```
