Modern utility and game framework for Python
Project description
🪺 Nestifypy Framework
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:
- Core Utilities: A suite of tools for intelligent configuration (YAML), declarative environment variable binding, cross-platform OS tasks, and CLI project scaffolding.
- Pyunix Game Engine (
nestifypy.pyunix): A fully declarative, decorator-driven 2D game engine built on top ofpygame, 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):
pip install nestifypy
Full Framework (Includes Pyunix Game Engine):
pip install "nestifypy[game]"
🚀 Usage Guide
1. Initializing a Project
Nestifypy comes with a CLI to scaffold a professional-grade project structure instantly:
nestifypy init --name my_app
2. Smart Configuration & Environment
Access parsed configurations instantly across your entire project.
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.
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
.envvariables directly to class properties using theEnvPropertydescriptor. - CLI Scaffolding: Generate projects with built-in support for
ruff,pytest, andmypy.
📚 Documentation
For detailed guides, please check the docs/ directory in our GitHub repository:
(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.
- 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.2.1.tar.gz.
File metadata
- Download URL: nestifypy-0.2.1.tar.gz
- Upload date:
- Size: 158.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
133ea25ba509c46f668257e887b53bc9e46f07bfa6e9a7d06ba58b1931eef61e
|
|
| MD5 |
4b7fdd54af703b02ba1746ed78863406
|
|
| BLAKE2b-256 |
a70e3853652a0a54c5ce07664e91547265203c0bf17212eb85b9e5ec95eaea37
|
File details
Details for the file nestifypy-0.2.1-py3-none-any.whl.
File metadata
- Download URL: nestifypy-0.2.1-py3-none-any.whl
- Upload date:
- Size: 189.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
297d4ae58f708e35308dbdcd154caab0b38a8511413d19dbadd271516b6d6106
|
|
| MD5 |
be3bb082aad2fdb2f8d81ff825d2dd09
|
|
| BLAKE2b-256 |
a8b668f2daa31f3899d3b34c7270796e0ab59712023f1a9a44c3b2cf6a0658bd
|