Modern utility and game framework for Python
Project description
Nestifypy is a production-ready, modular utility and game framework for Python. 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.
🚀 Key Features
🎮 Pyunix Game Engine (nestifypy.pyunix)
A fully declarative, decorator-driven engine built on top of pygame.
- No Boilerplate: Build games using
@Game,@Sprite, and@Scenewithout writing messywhile Truegame loops. - ECS-Friendly Architecture: Build isolated entities and manage them easily via
SpriteGroup. - Built-in 2D Physics: High-performance Rigidbody physics with spatial hashing,
BoxCollider/CircleCollider, and collision event hooks (@Sprite.on_collision_enter). - Declarative UI & Fonts: Advanced text rendering system with outlines, shadows, anchors, and caching via the
@Game.textdecorator. - Advanced Systems: Built-in
Camerawith smooth-follow and screenshake, flexibleAudiomanagement, and robustTimerlogic tied to game Delta-Time.
🛠️ Core Utilities
- Intelligent YAML Registry (
nestifypy.yaml): An advanced configuration engine that automatically scans, caches, and indexes your YAML files, providing instantO(1)access via dot-notation (e.g.,yaml.get("server.port")). - Declarative Environments (
nestifypy.env): Bind.envvariables directly to class properties using theEnvPropertydescriptor, or inject them into functions using@Env.inject. - System Tools (
nestifypy.os): Cross-platform, memory-efficient generators for file scanning, subprocess management, and directory operations. - CLI Ecosystem (
nestifypy cli): Scaffolding tools to generate professional-grade projects instantly with built-in support forruff,pytest, andmypy.
📦 Installation
Nestifypy requires Python 3.10 or higher.
To install the core utility framework (without Pygame dependencies):
pip install nestifypy
To install Nestifypy with full Pyunix Game Framework capabilities:
pip install "nestifypy[game]"
⚡ Quick Start
1. Initialize a Project
Use the CLI to scaffold a new project complete with a professional pyproject.toml and directory structure.
nestifypy init --name my_app
2. Building a Game (Pyunix)
Building a game loop is as simple as decorating a class.
from nestifypy.pyunix import Game, Entity, Rigidbody, BoxCollider, BodyType
from nestifypy.types import Vector2, Color
# 1. Define your Game
@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):
# 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 f"SCORE: 1000"
# 2. 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)
)
@Sprite.update
def movement(self, dt):
if self.input.is_action_pressed("jump"):
self.rigidbody.add_impulse(Vector2(0, -500))
# 3. Run!
if __name__ == "__main__":
game = MyGame()
game.run()
3. Smart Configuration & Env
Access parsed configurations instantly across your entire project.
from nestifypy import yaml
from nestifypy.env import Env
# Automatically loads .env file
Env.load()
api_key = Env.required("API_KEY")
# Fetches value from any scanned .yml file in the project natively
db_host = yaml.get("database.host")
📚 Documentation
Detailed guides and API references for each module can be found in the docs/ directory:
- 🎮 Pyunix Game Framework (Includes Physics & UI guides)
- ⚙️ YAML Intelligent Registry
- 🔒 Environment Management
- 📁 OS & File Utilities
- 📝 JSON Tools
- 🖥️ Console Tools
- 🧱 Core Systems (Logger/Plugins)
- ✨ Decorators
- ⏱️ Control Flow
- 🗃️ Collections
🤝 Contributing
Nestifypy is built with modern Python tools (uv, ruff, pytest). We welcome contributions!
- Clone the repository.
- Install development dependencies using
uvorpip:uv pip install -e ".[dev]"
- Run tests:
pytest
- Lint code:
ruff check .
🛡️ Security
Please review our Security Policy for information on reporting vulnerabilities.
📜 License
This project is licensed under the 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nestifypy-0.1.0.tar.gz.
File metadata
- Download URL: nestifypy-0.1.0.tar.gz
- Upload date:
- Size: 74.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
471d93bd6eb278b6dea3942ad8986405b89228335a7670712ce6584845074079
|
|
| MD5 |
6d26b485e4fd05fe84416c45faec9781
|
|
| BLAKE2b-256 |
30b1737e0231f761b52909d5a9ad6e5e5d34052c281205d84c4b6405f5d77acd
|
File details
Details for the file nestifypy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nestifypy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 89.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f3abb8509060d5d59d7d6c7eb8a2b61bfa60b130a53bde6373b12fb75d04578
|
|
| MD5 |
171ee93e746072aa195f4bf1fd4c2c24
|
|
| BLAKE2b-256 |
f15c9632357b4a74f30366552d16965087d9488257f8155715beff15c8c5023a
|