Skip to main content

A Pretty Project Framework

Project description

https://ci.appveyor.com/api/projects/status/j08891u3higxbw9u?svg=true

A pretty project framework for Python3 & PySide6.

I hope it is useful for you, too. :D

Dict Storage

All the project items’ values are stored in the project.value dict. The key is the item name. Generally this dict can be serialized and stored in the file if the dict can be pickled directly.

import prett


class ItemDemo(prett.IntProjectItem):
    pass

class ProjectDemo(prett.AbstractProject):
    def __init__(self):
        self.width = ItemDemo(self)
        self.height = ItemDemo(self)

p = ProjectDemo()
p.width.int.value = 16
p.height.int.value = 20
print(p.value)  # {'width': '16', 'height': '20'}

Type Conversion

In prett, there are default type conversion in string-int and string-float. When the item is inherited from StringIntItem, the item value is stored in string type, and its int property will automatically convert to or from string type.

import prett


class ItemDemo(prett.IntProjectItem):
    pass

class ProjectDemo(prett.AbstractProject):
    def __init__(self):
        self.length = ItemDemo(self)

p = ProjectDemo()
p.length.string.value = '200'
print(p.length.int.value)  # 200, type is int

Changed Signal

When the value of property change, the changed signals of project, item, and properties will be emitted.

import prett


class ItemDemo(prett.IntProjectItem):
    pass

class ProjectDemo(prett.AbstractProject):
    def __init__(self):
        self.width = ItemDemo(self)
        self.height = ItemDemo(self)

p = ProjectDemo()
p.width.int.value = 16  # p.changed signal emitted, p.width.changed emitted
                        # then p.width.string.changed emitted, p.width.int.changed emitted

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

prett6-1.0.1.tar.gz (10.7 kB view details)

Uploaded Source

File details

Details for the file prett6-1.0.1.tar.gz.

File metadata

  • Download URL: prett6-1.0.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for prett6-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5164eb023f71b799e4edd66bafa597014481f5019e1dfef066f49b32642db230
MD5 44db3ab4c31be3ccd3de5c3b918cde16
BLAKE2b-256 7212d361c4964b6d2390b8d86fc1a4467f6c94fb43c55c13161ba1f3ae3a0dfa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page