LyGui


NameLyGui JSON
Version 0.1.0b2.post1 PyPI version JSON
download
home_pageNone
SummaryLyGui (beta): zero-deps, pure-Python immediate-mode GUI with a software renderer.
upload_time2025-09-19 11:34:42
maintainerNone
docs_urlNone
authorDeathAmir
requires_python>=3.9
licenseMIT
keywords gui immediate lygui software renderer zero deps
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LyGui — Comprehensive Immediate‑Mode GUI (Beta, Zero‑Deps)

**LyGui** is a **fully independent, zero‑dependency** Immediate‑Mode GUI toolkit written in **pure Python**.  
No Tk, no PyQt, no SDL, no OpenGL, no Win32 — *nothing* outside the Python standard library.

> Version: `0.1.0b2` • License: **MIT** • Author: **DeathAmir**

---

## 🚀 Overview

- **Zero Dependencies:** Runs with the standard Python library only.
- **Immediate‑Mode API:** Clean, fresh names under the `LyGui` namespace.
- **Pure Software Renderer:** Internal rasterizer with a pixel framebuffer.
- **Modular Output Drivers:** By default, headless preview and PNG frame dump (both zero‑deps).  
  Future releases will add optional OS outputs via `ctypes` while keeping zero‑deps.

---

## 🌟 Features (Beta)

- **API (namespace `LyGui`):**
  - Layout/Windows: `Begin/End`, `BeginChild/EndChild`, `SameLine`, `Separator`, `SetNextWindowPos/Size`
  - Widgets: `Text`, `Button`, `Checkbox`, `InputText`, `SliderFloat`
  - Frame Control: `GetIO`, `GetStyle`, `NewFrame`, `Render`
- **Renderer:**
  - Rectangle/line fills, simple AA for lines, rounded corners (basic).
  - Built‑in tiny bitmap font for `Text` (ASCII subset).
- **Outputs (zero‑deps):**
  - `outputs.preview.run(ui, frames, fps)`: runs frames in memory (good for testing/benchmarks).
  - `outputs.framedump.run(..., make_gif=False)`: dumps frames as PNG via an internal encoder.

> Note: In beta, live on‑screen windows are intentionally not used to maintain absolute zero‑deps.  
> We will add optional cross‑platform OS outputs later (still packaged in‑tree).

---

## 📋 Requirements

- **OS:** Any OS that runs CPython (Windows / Linux / macOS).
- **Python:** 3.9 – 3.12
- **Extra libs:** None.

---

## 🛠️ Development Setup

```bash
git clone https://github.com/deathamir/LyGui.git
cd LyGui
pip install -U .
```

### Run the example
```bash
python examples/hello.py
```

**Example (`examples/hello.py`):**
```python
from lygui import LyGui
from lygui.outputs import preview, framedump

flag = True
val = 0.25
text = "Type here"

def ui():
    global flag, val, text
    LyGui.SetNextWindowPos(40, 40)
    LyGui.SetNextWindowSize(420, 300)
    LyGui.Begin("LyGui • Beta (Zero-Deps)")

    LyGui.Text("Immediate-Mode • zero dependencies")
    LyGui.Separator()

    if LyGui.Button("Click Me"):
        print("Clicked!")
    LyGui.SameLine()
    changed, flag = LyGui.Checkbox("Enable", flag)

    changed, val = LyGui.SliderFloat("Value", val, 0.0, 1.0)
    changed, text = LyGui.InputText("Name", text, width=240)

    LyGui.End()

# headless preview (no files written)
preview.run(ui, frames=60, fps=60)

# dump PNG frames
# framedump.run(ui, frames=60, fps=60, out_dir="out_frames", make_gif=False)
```

---

## 🧪 Testing

```bash
pytest
# with coverage if you install pytest-cov (optional)
pytest --cov=lygui --cov-report=term-missing
```

---

## 🔍 Dev Tools (Optional)

Zero‑deps core doesn’t require them, but for contributors:

- Formatting: **Black**
- Lint: **Ruff** or **Flake8**
- Types: **MyPy**
- Tests: **Pytest**

```bash
pip install -r requirements-dev.txt
black . && ruff check . && mypy lygui && pytest
```

---

## 📦 Project Structure

```
LyGui/
├── lygui/
│   ├── core.py            # Immediate-mode core + API namespace (LyGui)
│   ├── renderers/
│   │   ├── software.py    # Software rasterizer + framebuffer
│   │   └── text.py        # Tiny bitmap font renderer
│   ├── outputs/
│   │   ├── preview.py     # Headless frame runner
│   │   └── framedump.py   # Zero-deps PNG encoder + frame dump
│   └── utils/
│       └── color.py       # Color helpers
├── examples/
│   └── hello.py
├── tests/
│   ├── test_core.py
│   └── test_renderer.py
├── docs/
│   └── roadmap.md
├── pyproject.toml
├── LICENSE
└── README.md
```

---

## 🔒 Security

- No external native libraries → small attack surface.
- Input validation for widget values.
- Minimal logging; can be disabled.

---

## 🤝 Contributing

1. Fork the repo
2. Create a branch: `git checkout -b feat/your-feature`
3. Commit: `git commit -m "feat: add your-feature"`
4. Push: `git push origin feat/your-feature`
5. Open a Pull Request

**Guidelines:**
- Keep API clean and consistent
- Add tests for new features
- Maintain ≥ 80% coverage (goal)
- Update docs and examples

---

## 🧭 Roadmap

- Widgets: Menu/MenuBar, Popup/Modal, Tree/CollapsingHeader, Tables/Columns
- Drawing API: Path, Circles, ClipRect, Layers
- Fonts: Better text, caching, Unicode & RTL
- Outputs: Optional OS windows via `ctypes` (X11/Quartz/Wayland/DirectFrame)

---

## 📄 License

**MIT** — © 2025 **DeathAmir**

---

## 📞 Contact

- **Name:** Erton Miranda (DeathAmir)  
- **Email:** erton.miranda@example.com  
- **GitHub:** `@deathamir`

---

_Last updated: 2025-09-19_

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "LyGui",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "gui, immediate, lygui, software renderer, zero deps",
    "author": "DeathAmir",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/4b/53/ab799e62f7123b0fa4c6e87b9be4557e3ef7d76b01e8af3d23a1399871fb/lygui-0.1.0b2.post1.tar.gz",
    "platform": null,
    "description": "# LyGui \u2014 Comprehensive Immediate\u2011Mode GUI (Beta, Zero\u2011Deps)\r\n\r\n**LyGui** is a **fully independent, zero\u2011dependency** Immediate\u2011Mode GUI toolkit written in **pure Python**.  \r\nNo Tk, no PyQt, no SDL, no OpenGL, no Win32 \u2014 *nothing* outside the Python standard library.\r\n\r\n> Version: `0.1.0b2` \u2022 License: **MIT** \u2022 Author: **DeathAmir**\r\n\r\n---\r\n\r\n## \ud83d\ude80 Overview\r\n\r\n- **Zero Dependencies:** Runs with the standard Python library only.\r\n- **Immediate\u2011Mode API:** Clean, fresh names under the `LyGui` namespace.\r\n- **Pure Software Renderer:** Internal rasterizer with a pixel framebuffer.\r\n- **Modular Output Drivers:** By default, headless preview and PNG frame dump (both zero\u2011deps).  \r\n  Future releases will add optional OS outputs via `ctypes` while keeping zero\u2011deps.\r\n\r\n---\r\n\r\n## \ud83c\udf1f Features (Beta)\r\n\r\n- **API (namespace `LyGui`):**\r\n  - Layout/Windows: `Begin/End`, `BeginChild/EndChild`, `SameLine`, `Separator`, `SetNextWindowPos/Size`\r\n  - Widgets: `Text`, `Button`, `Checkbox`, `InputText`, `SliderFloat`\r\n  - Frame Control: `GetIO`, `GetStyle`, `NewFrame`, `Render`\r\n- **Renderer:**\r\n  - Rectangle/line fills, simple AA for lines, rounded corners (basic).\r\n  - Built\u2011in tiny bitmap font for `Text` (ASCII subset).\r\n- **Outputs (zero\u2011deps):**\r\n  - `outputs.preview.run(ui, frames, fps)`: runs frames in memory (good for testing/benchmarks).\r\n  - `outputs.framedump.run(..., make_gif=False)`: dumps frames as PNG via an internal encoder.\r\n\r\n> Note: In beta, live on\u2011screen windows are intentionally not used to maintain absolute zero\u2011deps.  \r\n> We will add optional cross\u2011platform OS outputs later (still packaged in\u2011tree).\r\n\r\n---\r\n\r\n## \ud83d\udccb Requirements\r\n\r\n- **OS:** Any OS that runs CPython (Windows / Linux / macOS).\r\n- **Python:** 3.9 \u2013 3.12\r\n- **Extra libs:** None.\r\n\r\n---\r\n\r\n## \ud83d\udee0\ufe0f Development Setup\r\n\r\n```bash\r\ngit clone https://github.com/deathamir/LyGui.git\r\ncd LyGui\r\npip install -U .\r\n```\r\n\r\n### Run the example\r\n```bash\r\npython examples/hello.py\r\n```\r\n\r\n**Example (`examples/hello.py`):**\r\n```python\r\nfrom lygui import LyGui\r\nfrom lygui.outputs import preview, framedump\r\n\r\nflag = True\r\nval = 0.25\r\ntext = \"Type here\"\r\n\r\ndef ui():\r\n    global flag, val, text\r\n    LyGui.SetNextWindowPos(40, 40)\r\n    LyGui.SetNextWindowSize(420, 300)\r\n    LyGui.Begin(\"LyGui \u2022 Beta (Zero-Deps)\")\r\n\r\n    LyGui.Text(\"Immediate-Mode \u2022 zero dependencies\")\r\n    LyGui.Separator()\r\n\r\n    if LyGui.Button(\"Click Me\"):\r\n        print(\"Clicked!\")\r\n    LyGui.SameLine()\r\n    changed, flag = LyGui.Checkbox(\"Enable\", flag)\r\n\r\n    changed, val = LyGui.SliderFloat(\"Value\", val, 0.0, 1.0)\r\n    changed, text = LyGui.InputText(\"Name\", text, width=240)\r\n\r\n    LyGui.End()\r\n\r\n# headless preview (no files written)\r\npreview.run(ui, frames=60, fps=60)\r\n\r\n# dump PNG frames\r\n# framedump.run(ui, frames=60, fps=60, out_dir=\"out_frames\", make_gif=False)\r\n```\r\n\r\n---\r\n\r\n## \ud83e\uddea Testing\r\n\r\n```bash\r\npytest\r\n# with coverage if you install pytest-cov (optional)\r\npytest --cov=lygui --cov-report=term-missing\r\n```\r\n\r\n---\r\n\r\n## \ud83d\udd0d Dev Tools (Optional)\r\n\r\nZero\u2011deps core doesn\u2019t require them, but for contributors:\r\n\r\n- Formatting: **Black**\r\n- Lint: **Ruff** or **Flake8**\r\n- Types: **MyPy**\r\n- Tests: **Pytest**\r\n\r\n```bash\r\npip install -r requirements-dev.txt\r\nblack . && ruff check . && mypy lygui && pytest\r\n```\r\n\r\n---\r\n\r\n## \ud83d\udce6 Project Structure\r\n\r\n```\r\nLyGui/\r\n\u251c\u2500\u2500 lygui/\r\n\u2502   \u251c\u2500\u2500 core.py            # Immediate-mode core + API namespace (LyGui)\r\n\u2502   \u251c\u2500\u2500 renderers/\r\n\u2502   \u2502   \u251c\u2500\u2500 software.py    # Software rasterizer + framebuffer\r\n\u2502   \u2502   \u2514\u2500\u2500 text.py        # Tiny bitmap font renderer\r\n\u2502   \u251c\u2500\u2500 outputs/\r\n\u2502   \u2502   \u251c\u2500\u2500 preview.py     # Headless frame runner\r\n\u2502   \u2502   \u2514\u2500\u2500 framedump.py   # Zero-deps PNG encoder + frame dump\r\n\u2502   \u2514\u2500\u2500 utils/\r\n\u2502       \u2514\u2500\u2500 color.py       # Color helpers\r\n\u251c\u2500\u2500 examples/\r\n\u2502   \u2514\u2500\u2500 hello.py\r\n\u251c\u2500\u2500 tests/\r\n\u2502   \u251c\u2500\u2500 test_core.py\r\n\u2502   \u2514\u2500\u2500 test_renderer.py\r\n\u251c\u2500\u2500 docs/\r\n\u2502   \u2514\u2500\u2500 roadmap.md\r\n\u251c\u2500\u2500 pyproject.toml\r\n\u251c\u2500\u2500 LICENSE\r\n\u2514\u2500\u2500 README.md\r\n```\r\n\r\n---\r\n\r\n## \ud83d\udd12 Security\r\n\r\n- No external native libraries \u2192 small attack surface.\r\n- Input validation for widget values.\r\n- Minimal logging; can be disabled.\r\n\r\n---\r\n\r\n## \ud83e\udd1d Contributing\r\n\r\n1. Fork the repo\r\n2. Create a branch: `git checkout -b feat/your-feature`\r\n3. Commit: `git commit -m \"feat: add your-feature\"`\r\n4. Push: `git push origin feat/your-feature`\r\n5. Open a Pull Request\r\n\r\n**Guidelines:**\r\n- Keep API clean and consistent\r\n- Add tests for new features\r\n- Maintain \u2265 80% coverage (goal)\r\n- Update docs and examples\r\n\r\n---\r\n\r\n## \ud83e\udded Roadmap\r\n\r\n- Widgets: Menu/MenuBar, Popup/Modal, Tree/CollapsingHeader, Tables/Columns\r\n- Drawing API: Path, Circles, ClipRect, Layers\r\n- Fonts: Better text, caching, Unicode & RTL\r\n- Outputs: Optional OS windows via `ctypes` (X11/Quartz/Wayland/DirectFrame)\r\n\r\n---\r\n\r\n## \ud83d\udcc4 License\r\n\r\n**MIT** \u2014 \u00a9 2025 **DeathAmir**\r\n\r\n---\r\n\r\n## \ud83d\udcde Contact\r\n\r\n- **Name:** Erton Miranda (DeathAmir)  \r\n- **Email:** erton.miranda@example.com  \r\n- **GitHub:** `@deathamir`\r\n\r\n---\r\n\r\n_Last updated: 2025-09-19_\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "LyGui (beta): zero-deps, pure-Python immediate-mode GUI with a software renderer.",
    "version": "0.1.0b2.post1",
    "project_urls": null,
    "split_keywords": [
        "gui",
        " immediate",
        " lygui",
        " software renderer",
        " zero deps"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d2fa98d0c877b7e96cb4d4dcd9864003f3f7dff708841f7d113abcf9ee44e991",
                "md5": "56ced8a7978d32bd03aac67d8bf48f8b",
                "sha256": "989422578cf6903fb3362365bf248452c3c2a3eeae77a9f34beb3f135b2b18ad"
            },
            "downloads": -1,
            "filename": "lygui-0.1.0b2.post1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "56ced8a7978d32bd03aac67d8bf48f8b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 13147,
            "upload_time": "2025-09-19T11:34:40",
            "upload_time_iso_8601": "2025-09-19T11:34:40.991430Z",
            "url": "https://files.pythonhosted.org/packages/d2/fa/98d0c877b7e96cb4d4dcd9864003f3f7dff708841f7d113abcf9ee44e991/lygui-0.1.0b2.post1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4b53ab799e62f7123b0fa4c6e87b9be4557e3ef7d76b01e8af3d23a1399871fb",
                "md5": "c1d7e56eceb63b84a1525159dfdf9130",
                "sha256": "aeff01b2e799a08293abe32452322d00c6a00cfe8ebc1b9b823323fd662b5e63"
            },
            "downloads": -1,
            "filename": "lygui-0.1.0b2.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "c1d7e56eceb63b84a1525159dfdf9130",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 11104,
            "upload_time": "2025-09-19T11:34:42",
            "upload_time_iso_8601": "2025-09-19T11:34:42.237711Z",
            "url": "https://files.pythonhosted.org/packages/4b/53/ab799e62f7123b0fa4c6e87b9be4557e3ef7d76b01e8af3d23a1399871fb/lygui-0.1.0b2.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-19 11:34:42",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "lygui"
}
        
Elapsed time: 0.92652s