pizzoo


Namepizzoo JSON
Version 0.9.12 PyPI version JSON
download
home_pagehttps://github.com/pabletos/pizzoo#readme
SummaryPizzoo is a easy-to-use library for rendering on pixel matrix screens like the Pixoo64, featuring easy new device integration, animation tools, and XML template rendering support.
upload_time2024-10-07 19:37:13
maintainerNone
docs_urlNone
authorPablo Huet
requires_pythonNone
licenseMIT
keywords pixoo pixoo64 divoom screen pixel matrix render buffer led matrix led raspberry raspberry pi
VCS
bugtrack_url
requirements Pillow requests bdfparser
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img src="https://raw.githubusercontent.com/pabletos/pizzoo/main/docs/docs/assets/images/pizzoo-banner-nobg.png" alt="Pizzoo logo" width="450">
</p>
<p>
	<a 
	href='https://ko-fi.com/B0B1PYK0W'
	target='_blank'
	rel="noreferrer"
	>
	<img src='https://img.shields.io/badge/donate-blue?logo=ko-fi&logoColor=%23ffffff' border='0' alt='Buy Me a Coffee at ko-fi.com' />
	</a>
	<a
	href="https://pizzoo.pablohuet.com"
	target="_blank"
	rel="noreferrer"
	>
		<img src="https://img.shields.io/badge/-docs-red?logo=readthedocs&logoColor=white">
	</a>
	<a
	href='https://pypi.org/project/pizzoo/'
	target='_blank'
	rel="noreferrer"
	>
	<img src="https://img.shields.io/pypi/v/pizzoo?logo=pypi&label=version&logoColor=%23ffffff"/>
	</a>
	<img src="https://img.shields.io/pypi/dm/pizzoo?logo=pypi&logoColor=%23ffffff"/>
</p>

Pizzoo is a robust Python library designed for developers who want to unlock the full potential of matrix LED displays, particularly the Pixoo64, a 64x64 pixel LED display, and extend its functionalities to various other devices. Whether you're looking to create dynamic animations, develop interactive games, or integrate unique display functionalities, Pizzoo provides you with the tools and flexibility to innovate and express your creative ideas.

## Features

* **Full Animation Creation and Control**:
	With frame-by-frame programatic drawing capabilities you can craft detailed animations directly on your LED display, allowing you to visually conceptualize, iterate, and render animations seamlessly.

* **Template Rendering**:
	Our built-in compiler supports an XML/HTML-like language for template processing. This facilitates the design of UIs with relative positioning, defined areas, and reusable components, helping you creating fast and reusable interfaces.

* **Flexible integration with any device**:
	Even with the Pixoo64 being the default target, the Renderer class can be easily extended to support additional methods and integrate with various hardware. This ensures that Pizzoo can adapt to your specific project and hardware requirements.

* **Game Development Toolkit**:
	Tap into the possibilities of micro game development with our mini game engine. Design, develop, and deploy small-scale games that can be played right on your LED devices, perfect for creating engaging interactive experiences.

## Install

Just use pip to install the package:
```bash
pip install pizzoo
```
That's it! Everything should be installed correctly and pizzoo is ready to be used!

## Drawing on your device
Frame manipulation is the core of the `pizzoo` library. Every time the library is created and the `render` method is called, the buffer is filled with a new frame we can use to draw on. Lets start by drawing three pixels on the screen and rendering:

```python
pizzoo.cls()
pizzoo.draw_circle((31, 31), 10, '#00ff00', filled=True) # Green circle, filled
pizzoo.draw_rectangle((26, 26), 11, 11, '#ff0000', filled=False) # Red rectangle, not filled
pizzoo.draw_line((31, 0), (31, 63), '#0000ff') # Blue line
pizzoo.draw_line((0, 31), (63, 31), (255, 255, 0)) # Yellow line, tuple rgb color format
pizzoo.render()
```

<p align="center">
  <img width="320" height="320" src="https://raw.githubusercontent.com/pabletos/pizzoo/main/docs/docs/assets/images/qs-2.png">
</p>

## Creating animations
Aside from simple gif drawing (That is also supported), custom animations can be created using frame-by-frame manipulation. As an example:

```python
'''
This will create a simple diagonal moving circle
'''
for i in range(0, 54):
	pizzoo.cls()
	pizzoo.draw_circle((i + 4, i + 4), 2, '#00ff00', filled=True)
	pizzoo.add_frame()
pizzoo.render(frame_speed=100)
```

<p align="center">
	<img width="320" height="320" src="https://raw.githubusercontent.com/pabletos/pizzoo/main/docs/docs/assets/images/qs-5.gif">
</p>


## Rendering templates
The most powerful feature of this library is the ability of render templates. Custom XML/HTML like templates can be made to create images, Pixoo64 dials and even reusable parts or components.

```python
'''
This template uses custom nodes for Pixoo64 for creating auto-updating dials, as date or time, so these are missing when 
rendering on any other renderer
'''
pizzoo.load_font('amstrad', './files/amstrad_cpc_extended.bdf')
pizzoo.render_template('''
	<pizzoo>
		<rectangle x="0" y="0" width="100%" height="100%" color="8" filled="true">
			<section x="0" y="2">
				<date format="DD" x="1" color="#ffc107" font="small"></date>
				<text x="9" color="#ffc107">-</text>
				<date format="MM" x="13" color="#ffc107" font="small"></date>
				<time format="HH:mm" x="26" font="small"></time>
				<date format="WWW" width="63" x="50" color="#ffc107" font="small"></date>
			</section>
			<section x="5" y="10" width="53" height="43">
				<rectangle x="0" y="0" width="100%" height="100%" color="#FFFFFF" filled="true" />
				<section x="1" y="1" width="51" height="51">
					<text x="0" y="0" color="#000000" wrap="true">Long text wrapped</text>
					<text x="10" y="80%" shadow="diagonal" color="#FF0000" font="amstrad">Cool</text>
					<image x="17" y="40%" src="./files/test_image.png" />
				</section>
			</section>
		</rectangle>
	</pizzoo>
''')
```

Template rendering provide a lot of options, including self-updating time, date, weather...(Using tags like <date>, <time> and so on) and even support for using images or gifs as backgrounds (check the examples).

<p align="center">
	<img width="320" height="320" src="https://raw.githubusercontent.com/pabletos/pizzoo/main/docs/docs/assets/images/qs-6.png">
</p>


There's also have a dedicated section for this on our docs.

## Do you want to know more?
[Here's](pizzoo.pablohuet.com) a dedicated page for documentation with a lot of examples so you can get quickly started.

## Contribute and/or donate
This library was created and is maintained by a single developer, consider contributing with pull requests, new integrations, proposals or [simply by doing a small donation on ko-fi](https://ko-fi.com/B0B1PYK0W).

## Special thanks
This library exists thanks to other libraries that were an inspiration, specially the [Pixoo](https://github.com/SomethingWithComputers/pixoo) library by SomethingWithComputers and the [Matrix-Fonts](https://github.com/trip5/Matrix-Fonts/tree/main) matrix bdf font collection by trip5.

Also I want to give a special thanks [to my lovely fiancee](https://github.com/srtashadowfax) for all her support while developing this library, both technical and emotional 💖

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pabletos/pizzoo#readme",
    "name": "pizzoo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "pixoo, pixoo64, divoom, screen, pixel, matrix, render, buffer, LED matrix, LED, raspberry, raspberry pi",
    "author": "Pablo Huet",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9a/c8/047cf2f2aa459790be5e0321fda4e0e8cfa1c92cffd66ace031094ab4255/pizzoo-0.9.12.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\r\n  <img src=\"https://raw.githubusercontent.com/pabletos/pizzoo/main/docs/docs/assets/images/pizzoo-banner-nobg.png\" alt=\"Pizzoo logo\" width=\"450\">\r\n</p>\r\n<p>\r\n\t<a \r\n\thref='https://ko-fi.com/B0B1PYK0W'\r\n\ttarget='_blank'\r\n\trel=\"noreferrer\"\r\n\t>\r\n\t<img src='https://img.shields.io/badge/donate-blue?logo=ko-fi&logoColor=%23ffffff' border='0' alt='Buy Me a Coffee at ko-fi.com' />\r\n\t</a>\r\n\t<a\r\n\thref=\"https://pizzoo.pablohuet.com\"\r\n\ttarget=\"_blank\"\r\n\trel=\"noreferrer\"\r\n\t>\r\n\t\t<img src=\"https://img.shields.io/badge/-docs-red?logo=readthedocs&logoColor=white\">\r\n\t</a>\r\n\t<a\r\n\thref='https://pypi.org/project/pizzoo/'\r\n\ttarget='_blank'\r\n\trel=\"noreferrer\"\r\n\t>\r\n\t<img src=\"https://img.shields.io/pypi/v/pizzoo?logo=pypi&label=version&logoColor=%23ffffff\"/>\r\n\t</a>\r\n\t<img src=\"https://img.shields.io/pypi/dm/pizzoo?logo=pypi&logoColor=%23ffffff\"/>\r\n</p>\r\n\r\nPizzoo is a robust Python library designed for developers who want to unlock the full potential of matrix LED displays, particularly the Pixoo64, a 64x64 pixel LED display, and extend its functionalities to various other devices. Whether you're looking to create dynamic animations, develop interactive games, or integrate unique display functionalities, Pizzoo provides you with the tools and flexibility to innovate and express your creative ideas.\r\n\r\n## Features\r\n\r\n* **Full Animation Creation and Control**:\r\n\tWith frame-by-frame programatic drawing capabilities you can craft detailed animations directly on your LED display, allowing you to visually conceptualize, iterate, and render animations seamlessly.\r\n\r\n* **Template Rendering**:\r\n\tOur built-in compiler supports an XML/HTML-like language for template processing. This facilitates the design of UIs with relative positioning, defined areas, and reusable components, helping you creating fast and reusable interfaces.\r\n\r\n* **Flexible integration with any device**:\r\n\tEven with the Pixoo64 being the default target, the Renderer class can be easily extended to support additional methods and integrate with various hardware. This ensures that Pizzoo can adapt to your specific project and hardware requirements.\r\n\r\n* **Game Development Toolkit**:\r\n\tTap into the possibilities of micro game development with our mini game engine. Design, develop, and deploy small-scale games that can be played right on your LED devices, perfect for creating engaging interactive experiences.\r\n\r\n## Install\r\n\r\nJust use pip to install the package:\r\n```bash\r\npip install pizzoo\r\n```\r\nThat's it! Everything should be installed correctly and pizzoo is ready to be used!\r\n\r\n## Drawing on your device\r\nFrame manipulation is the core of the `pizzoo` library. Every time the library is created and the `render` method is called, the buffer is filled with a new frame we can use to draw on. Lets start by drawing three pixels on the screen and rendering:\r\n\r\n```python\r\npizzoo.cls()\r\npizzoo.draw_circle((31, 31), 10, '#00ff00', filled=True) # Green circle, filled\r\npizzoo.draw_rectangle((26, 26), 11, 11, '#ff0000', filled=False) # Red rectangle, not filled\r\npizzoo.draw_line((31, 0), (31, 63), '#0000ff') # Blue line\r\npizzoo.draw_line((0, 31), (63, 31), (255, 255, 0)) # Yellow line, tuple rgb color format\r\npizzoo.render()\r\n```\r\n\r\n<p align=\"center\">\r\n  <img width=\"320\" height=\"320\" src=\"https://raw.githubusercontent.com/pabletos/pizzoo/main/docs/docs/assets/images/qs-2.png\">\r\n</p>\r\n\r\n## Creating animations\r\nAside from simple gif drawing (That is also supported), custom animations can be created using frame-by-frame manipulation. As an example:\r\n\r\n```python\r\n'''\r\nThis will create a simple diagonal moving circle\r\n'''\r\nfor i in range(0, 54):\r\n\tpizzoo.cls()\r\n\tpizzoo.draw_circle((i + 4, i + 4), 2, '#00ff00', filled=True)\r\n\tpizzoo.add_frame()\r\npizzoo.render(frame_speed=100)\r\n```\r\n\r\n<p align=\"center\">\r\n\t<img width=\"320\" height=\"320\" src=\"https://raw.githubusercontent.com/pabletos/pizzoo/main/docs/docs/assets/images/qs-5.gif\">\r\n</p>\r\n\r\n\r\n## Rendering templates\r\nThe most powerful feature of this library is the ability of render templates. Custom XML/HTML like templates can be made to create images, Pixoo64 dials and even reusable parts or components.\r\n\r\n```python\r\n'''\r\nThis template uses custom nodes for Pixoo64 for creating auto-updating dials, as date or time, so these are missing when \r\nrendering on any other renderer\r\n'''\r\npizzoo.load_font('amstrad', './files/amstrad_cpc_extended.bdf')\r\npizzoo.render_template('''\r\n\t<pizzoo>\r\n\t\t<rectangle x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" color=\"8\" filled=\"true\">\r\n\t\t\t<section x=\"0\" y=\"2\">\r\n\t\t\t\t<date format=\"DD\" x=\"1\" color=\"#ffc107\" font=\"small\"></date>\r\n\t\t\t\t<text x=\"9\" color=\"#ffc107\">-</text>\r\n\t\t\t\t<date format=\"MM\" x=\"13\" color=\"#ffc107\" font=\"small\"></date>\r\n\t\t\t\t<time format=\"HH:mm\" x=\"26\" font=\"small\"></time>\r\n\t\t\t\t<date format=\"WWW\" width=\"63\" x=\"50\" color=\"#ffc107\" font=\"small\"></date>\r\n\t\t\t</section>\r\n\t\t\t<section x=\"5\" y=\"10\" width=\"53\" height=\"43\">\r\n\t\t\t\t<rectangle x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" color=\"#FFFFFF\" filled=\"true\" />\r\n\t\t\t\t<section x=\"1\" y=\"1\" width=\"51\" height=\"51\">\r\n\t\t\t\t\t<text x=\"0\" y=\"0\" color=\"#000000\" wrap=\"true\">Long text wrapped</text>\r\n\t\t\t\t\t<text x=\"10\" y=\"80%\" shadow=\"diagonal\" color=\"#FF0000\" font=\"amstrad\">Cool</text>\r\n\t\t\t\t\t<image x=\"17\" y=\"40%\" src=\"./files/test_image.png\" />\r\n\t\t\t\t</section>\r\n\t\t\t</section>\r\n\t\t</rectangle>\r\n\t</pizzoo>\r\n''')\r\n```\r\n\r\nTemplate rendering provide a lot of options, including self-updating time, date, weather...(Using tags like <date>, <time> and so on) and even support for using images or gifs as backgrounds (check the examples).\r\n\r\n<p align=\"center\">\r\n\t<img width=\"320\" height=\"320\" src=\"https://raw.githubusercontent.com/pabletos/pizzoo/main/docs/docs/assets/images/qs-6.png\">\r\n</p>\r\n\r\n\r\nThere's also have a dedicated section for this on our docs.\r\n\r\n## Do you want to know more?\r\n[Here's](pizzoo.pablohuet.com) a dedicated page for documentation with a lot of examples so you can get quickly started.\r\n\r\n## Contribute and/or donate\r\nThis library was created and is maintained by a single developer, consider contributing with pull requests, new integrations, proposals or [simply by doing a small donation on ko-fi](https://ko-fi.com/B0B1PYK0W).\r\n\r\n## Special thanks\r\nThis library exists thanks to other libraries that were an inspiration, specially the [Pixoo](https://github.com/SomethingWithComputers/pixoo) library by SomethingWithComputers and the [Matrix-Fonts](https://github.com/trip5/Matrix-Fonts/tree/main) matrix bdf font collection by trip5.\r\n\r\nAlso I want to give a special thanks [to my lovely fiancee](https://github.com/srtashadowfax) for all her support while developing this library, both technical and emotional \ud83d\udc96\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Pizzoo is a easy-to-use library for rendering on pixel matrix screens like the Pixoo64, featuring easy new device integration, animation tools, and XML template rendering support.",
    "version": "0.9.12",
    "project_urls": {
        "Homepage": "https://github.com/pabletos/pizzoo#readme"
    },
    "split_keywords": [
        "pixoo",
        " pixoo64",
        " divoom",
        " screen",
        " pixel",
        " matrix",
        " render",
        " buffer",
        " led matrix",
        " led",
        " raspberry",
        " raspberry pi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9ac8047cf2f2aa459790be5e0321fda4e0e8cfa1c92cffd66ace031094ab4255",
                "md5": "78f0725a71d973dc269445273937371b",
                "sha256": "e598a0226f7c705c252c26fb4fa71ce75a2db9a2c6a76e597e267bd14992d3f0"
            },
            "downloads": -1,
            "filename": "pizzoo-0.9.12.tar.gz",
            "has_sig": false,
            "md5_digest": "78f0725a71d973dc269445273937371b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 35233,
            "upload_time": "2024-10-07T19:37:13",
            "upload_time_iso_8601": "2024-10-07T19:37:13.420085Z",
            "url": "https://files.pythonhosted.org/packages/9a/c8/047cf2f2aa459790be5e0321fda4e0e8cfa1c92cffd66ace031094ab4255/pizzoo-0.9.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-07 19:37:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pabletos",
    "github_project": "pizzoo#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "Pillow",
            "specs": [
                [
                    "~=",
                    "10.0.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "~=",
                    "2.31.0"
                ]
            ]
        },
        {
            "name": "bdfparser",
            "specs": [
                [
                    "~=",
                    "2.2.0"
                ]
            ]
        }
    ],
    "lcname": "pizzoo"
}
        
Elapsed time: 4.07631s