Metadata-Version: 2.4
Name: nestifypy
Version: 0.2.1
Summary: Modern utility and game framework for Python
Author: rickmviana
License: MIT
Project-URL: Homepage, https://github.com/nadezhdkov/nestifypy
Project-URL: Repository, https://github.com/nadezhdkov/nestifypy
Project-URL: Bug Tracker, https://github.com/nadezhdkov/nestifypy/issues
Keywords: game,framework,utility,yaml,pygame,ecs,env
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Games/Entertainment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyyaml>=6.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: typer>=0.12
Requires-Dist: watchdog>=4.0
Requires-Dist: pygame>=2.6.1
Provides-Extra: game
Requires-Dist: pygame>=2.5; extra == "game"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: black>=24.0; extra == "dev"
Dynamic: license-file

# 🪺 Nestifypy Framework

[![Build Status](https://img.shields.io/badge/build-passing-brightgreen?style=flat-square)](https://github.com/nestifypy/nestifypy/actions)
[![Python Version](https://img.shields.io/badge/python-3.10%2B-blue?style=flat-square&logo=python&logoColor=white)](https://pypi.org/project/nestifypy/)
[![License](https://img.shields.io/badge/license-MIT-green?style=flat-square)](LICENSE)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Security Policy](https://img.shields.io/badge/security-policy-lightgrey?style=flat-square)](SECURITY.md)

**Nestifypy** is a modern, declarative utility and game framework for Python 3.10+. It provides a highly declarative, decorator-driven approach to application development, focusing on performance, developer ergonomics, and strict type safety.

Whether you are building complex CLI tools, managing intelligent configuration registries, or developing 2D physics-based games, Nestifypy provides a robust foundation.

## 📖 Overview

Nestifypy is divided into two main domains:
1. **Core Utilities:** A suite of tools for intelligent configuration (YAML), declarative environment variable binding, cross-platform OS tasks, and CLI project scaffolding.
2. **Pyunix Game Engine (`nestifypy.pyunix`):** A fully declarative, decorator-driven 2D game engine built on top of `pygame`, featuring built-in physics (Rigidbodies, Colliders), ECS-friendly architecture, and declarative UI.

## 📦 Installation

Nestifypy requires **Python 3.10 or higher**.

**Core Framework Only (No Pygame dependencies):**
```bash
pip install nestifypy
```

**Full Framework (Includes Pyunix Game Engine):**
```bash
pip install "nestifypy[game]"
```

## 🚀 Usage Guide

### 1. Initializing a Project

Nestifypy comes with a CLI to scaffold a professional-grade project structure instantly:
```bash
nestifypy init --name my_app
```

### 2. Smart Configuration & Environment

Access parsed configurations instantly across your entire project.

```python
from nestifypy import yaml
from nestifypy.env import Env

# Automatically load .env file
Env.load()
api_key = Env.required("API_KEY")

# Fetch values natively from any scanned .yml file using dot-notation
db_host = yaml.get("database.host") 
```

### 3. Building a Game (Pyunix)

Building a game loop is as simple as decorating a class. No messy `while True` loops.

```python
from nestifypy.pyunix import Game, Entity, Rigidbody, BoxCollider, BodyType
from nestifypy.types import Vector2, Color

# Define your Game using decorators
@Game(title="My Awesome Game", size=(800, 600), fps=60)
class MyGame:
    @Game.start
    def start(self):
        print("Engine Initialized!")
        self.player = Player(x=400, y=300)

    @Game.update
    def update(self, dt: float):
        # Frame-by-frame game logic here
        pass

    @Game.draw
    def draw(self, screen):
        screen.fill(Color.BLACK.to_tuple())

    @Game.text(x=10, y=10, size=24, color="white", outline=True)
    def score_ui(self):
        return "SCORE: 1000"

# Define your Entities with Physics
class Player(Entity):
    def __init__(self, x, y):
        super().__init__(
            x=x, y=y,
            layer="player",
            rigidbody=Rigidbody(body_type=BodyType.DYNAMIC, mass=1.0),
            collider=BoxCollider(width=32, height=32)
        )

    @Entity.update
    def movement(self, dt):
        if self.input.is_action_pressed("jump"):
            self.rigidbody.add_impulse(Vector2(0, -500))

if __name__ == "__main__":
    game = MyGame()
    game.run()
```

## ✨ Features

- **No Boilerplate Game Loops:** Build games using `@Game`, `@Entity`, and `@Scene`.
- **Built-in 2D Physics:** High-performance Rigidbody physics, spatial hashing, `BoxCollider` / `CircleCollider`, and collision hooks.
- **Intelligent YAML Registry:** Caches and indexes YAML files for `O(1)` dot-notation access.
- **Declarative Environments:** Bind `.env` variables directly to class properties using the `EnvProperty` descriptor.
- **CLI Scaffolding:** Generate projects with built-in support for `ruff`, `pytest`, and `mypy`.

## 📚 Documentation

For detailed guides, please check the `docs/` directory in our GitHub repository:
- 🎮 [Pyunix Game Framework](https://github.com/nestifypy/nestifypy/tree/main/docs/pyunix.md)
- ⚙️ [YAML Intelligent Registry](https://github.com/nestifypy/nestifypy/tree/main/docs/yaml.md)
- 🔒 [Environment Management](https://github.com/nestifypy/nestifypy/tree/main/docs/env.md)
- 📁 [OS & File Utilities](https://github.com/nestifypy/nestifypy/tree/main/docs/os.md)

*(Note: Documentation links assume you are browsing on GitHub. More modules available in the repository.)*

## 🤝 Contributing

We welcome contributions! Please review our repository if you are interested in helping out.
1. Clone the repository.
2. Install development dependencies using `uv` or `pip`: `uv pip install -e ".[dev]"`
3. Run tests: `pytest`
4. Lint code: `ruff check .`

## 🛡️ Security

Please review our [Security Policy](SECURITY.md) for information on reporting vulnerabilities.

## 📜 License

This project is licensed under the [MIT License](LICENSE).
