Skip to main content

:cat: Cattt

Cattt (kˈæt) is a pure Python cross-platform UI framework.

Documentation Site

Goals

The primary final goal of Cattt is to provide features for Python programmers easy to create a GUI application for several OS platforms and web browsers in a single most same code as possible as. The second goal is to provide a UI framework that Python programmers can easily understand, modify, and extend as needed. (Stated on May 25, 2022: This goal is the final goal. Currently this framework is in the super early stage, so this goal is far away. I hope to get much closer to the goal in a few months or a year by improving the implementation or documentation a little bit every day as much as possible.)

Features

  • The core part as a UI framework of Cattt is written in only Python. It's not a wrapper for existing something written in other programing languages.
  • Cattt allows human to define UI declaratively in Python.
  • Cattt provides hot-reloading or hot-restarting on development.
  • Dark mode is supported. If the runtime environment is in dark mode, Cattt app's UI appearance will automatically be styled in dark mode.
  • Cattt utilizes GPU via dependent libraries.

Dependencies

  • For desktop platforms, Cattt is standing on existing excellent python bindings for window management library (GLFW or SDL2) and 2D graphics library (Skia).
  • For web browsers, Cattt is standing on awesome Pyodide/PyScript and CanvasKit (Wasm version of Skia).

Installation

https://i2y.github.io/cattt/getting-started/

An example of code using Cattt

from cattt.core import App, Button, Column, Component, Row, State, Text
from cattt.frame import Frame


class Counter(Component):
    def __init__(self):
        super().__init__()
        self._count = State(0)

    def view(self):
        return Column(
            Text(self._count),
            Row(
                Button("Up", font_size=50).on_click(self.up),
                Button("Down", font_size=50).on_click(self.down),
            ),
        )

    def up(self, _):
        self._count += 1

    def down(self, _):
        self._count -= 1


App(Frame("Counter", 800, 600), Counter()).run()

https://user-images.githubusercontent.com/6240399/171010621-8c0068d2-eb90-4332-8a1b-115291053d42.mp4

You can see some other examples in examples directory.

Supported Platforms

Currently, Cattt theoretically should support not-too-old versions of the following platforms.

  • Windows 10/11
  • Mac OS X
  • Linux
  • Web browsers

Unfortunately, however, I could not actually confirm this at all on Linux, as I don't have a Linux machine these days. I want it.. Also, currently I have a only windows machine and it had already been updated to Windows 11, so I now confirm only it on Windows 11. So, If anyone have an environment other than Windows 11, it would be helpful if you could try it and report back to me if you have any problems. If you find any problems, it would be more helpul if you could fix it.

License

MIT License

Copyright (c) 2022 Yasushi Itoh

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for cattt 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cattt 0.1.4
File Size Uploaded Provenance Actions
cattt-0.1.4.tar.gz 27.2 kB Without provenance Details for cattt-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cattt 0.1.4
File Interpreter ABI Platform Actions
cattt-0.1.4-py3-none-any.whl Python 3 none any Details for cattt-0.1.4-py3-none-any.whl

Total release size: 57.4 kB

Release files / cattt-0.1.4.tar.gz

Download URL cattt-0.1.4.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5b1bd6288efd238cd4a478169d9942350d1d93b8740d50d2125aa1145a5da239
BLAKE2b-256 checksum
How to use checksums
72cdf21a911fa82bcfd228dd1324f525eeabdff42b87c48b618f29fef61ee7e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.2 Windows/10

Release files / cattt-0.1.4-py3-none-any.whl

Download URL cattt-0.1.4-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05f88aa5b9d964afe1e4af0fd15d99bbd130539f040e6dec12b29f5f92b559b5
BLAKE2b-256 checksum
How to use checksums
a4ede8b6349476ea1ff35a528ad0d527bcbdbf8d20eed484357133ce5d64d1e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.2 Windows/10

Security for cattt 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page