Skip to main content

UIClasses - Data-Modeling for User Interfaces

https://img.shields.io/pypi/dm/uiclasses https://img.shields.io/codecov/c/github/gabrielfalcao/uiclasses https://github.com/gabrielfalcao/uiclasses/actions/workflows/main.yml/badge.svg https://img.shields.io/readthedocs/uiclasses https://img.shields.io/github/license/gabrielfalcao/uiclasses?label=Github%20License https://img.shields.io/pypi/v/uiclasses https://img.shields.io/pypi/l/uiclasses?label=PyPi%20License https://img.shields.io/pypi/format/uiclasses https://img.shields.io/pypi/status/uiclasses https://img.shields.io/pypi/pyversions/uiclasses https://img.shields.io/pypi/implementation/uiclasses https://img.shields.io/snyk/vulnerabilities/github/gabrielfalcao/uiclasses https://img.shields.io/github/v/tag/gabrielfalcao/uiclasses
  • Powered by Python 3 Data Classes.

  • Objects optimized for user interfaces.

  • Methods to traverse nested dicts, convert to and from json

  • ModelList and ModelSet collections for robust manipulation of collections of models.

  • No I/O happens in models.

  • Collections can be easily cached to leverage responsive user interfaces.

Installation

pip install uiclasses

Basic Usage

from uiclasses import Model


class BlogPost(Model):
    id: int
    title: str
    body: str


post1 = BlogPost({"id": 1, "title": "title 1", "body": "body 1", "wimsical_extra_field": "lala land"})
post2 = BlogPost(id=2, title="title 2", body="body 2", extradata='stored but invisible')

published = BlogPost.List([post1, post2])

print(published.format_pretty_table())
https://github.com/gabrielfalcao/uiclasses/raw/master/docs/source/_static/screenshot-blog-list-pretty-table.png
print(published.format_robust_table())
https://github.com/gabrielfalcao/uiclasses/raw/master/docs/source/_static/screenshot-blog-list-robust-table.png

Notes:

  • This is not designed to be fast, when adding data to models their types might cast and validated, which is costly. - filtering collections by string values cause glob match

Metadata

Release files for uiclasses 3.0.0

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

Source distribution (sdist)

Source distribution for uiclasses 3.0.0
File Size Uploaded Provenance Actions
uiclasses-3.0.0.tar.gz 17.2 kB Without provenance Details for uiclasses-3.0.0.tar.gz

Release files / uiclasses-3.0.0.tar.gz

Download URL uiclasses-3.0.0.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
78567a63e491c8d18c60310a8e47404a966be6c723c03f48e1b9b48814a8a0d6
BLAKE2b-256 checksum
How to use checksums
b793c1400221f33224f8d5081a5a58ad523a5c8688fedba689297eaa9c2bf352
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for uiclasses 3.0.0

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