prett: A Pretty Project Framework
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
Metadata
Release files for prett6 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prett6-1.0.4.tar.gz | 12.1 kB | Without provenance | Details for prett6-1.0.4.tar.gz |
Release files / prett6-1.0.4.tar.gz
| Download URL | prett6-1.0.4.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34e143dc2ddf817932b60aac461aada96b2325c5b1c02014088c32e45409fff9
|
|
BLAKE2b-256 checksum How to use checksums |
6ded97390f0655e7454fbb254427f248bd71a98dc491df52dadf0b3e71ec1c23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Security for prett6 1.0.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.