Skip to main content

Edit your pydantic models with a nice GUI - CRUD Create Update Replace Delete

Project description

NiceCRUD

NiceCRUD is a CRUD (Create, Read, Update, Delete) interface built with python. The library integrates with pydantic models and NiceGUI to handle data manipulation with a browser interface.

Features

  • Automatically generate CRUD interfaces from pydantic models.
  • Field options, ranges, constraints, descriptions etc. are directly taken from your pydantic model
  • Integrated validation and error handling with pydantic.
  • Support for nested models and selection options.
  • Inject your own (database?) update methods
  • Minimal configuration required with sensible defaults.

Screenshots

Taken from the input_choices example:

CRUD Interface Screenshot - Grid of objects CRUD Interface Screenshot - Editing objects

Installation

To install NiceCRUD, use pip:

pip install niceguicrud

Quick Start

Here is a very basic example:

from nicegui import ui
from pydantic import BaseModel, Field

from niceguicrud import NiceCRUD


class MyModel(BaseModel, title="User"):
    id: int
    name: str = Field(title="Name")
    age: int = Field(gt=0, title="Age")


instance1 = MyModel(id=1, name="Alice", age=30)
instance2 = MyModel(id=2, name="Bob", age=25)
crud_app = NiceCRUD(basemodels=[instance1, instance2], id_field="id", heading="User Management")

ui.run()

Find more in the examples folder.

Example Name Description
minimal The above minimal example
validation Example showcasing how pydantic validation features are used in the GUI
submodel Demonstrates usage of a pydantic submodel that can also be used in the GUI.
input_choices Shows the different input choices.
database Shows how to customize the update, create and delete operations

Contributing

Contributions are welcome!

Publishing new versions

Make sure that the environment variable UV_PUBLISH_TOKEN is set to a pypi secret token.

uv build
uv publish

License

This project is licensed under the MIT License. See the LICENSE.

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

niceguicrud-0.1.12.tar.gz (282.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

niceguicrud-0.1.12-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file niceguicrud-0.1.12.tar.gz.

File metadata

  • Download URL: niceguicrud-0.1.12.tar.gz
  • Upload date:
  • Size: 282.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for niceguicrud-0.1.12.tar.gz
Algorithm Hash digest
SHA256 ada90ee75476247fa3d7ce7850831dfa6fdcce3dbfa67032140c3c711d4150b9
MD5 760dd9931ecb4fde9d00ea5ba48a52ae
BLAKE2b-256 8a7ac1bd412bdf9c449d0dd1f5176fc65be162a4f666fbc18f33a6f2e4573a2e

See more details on using hashes here.

File details

Details for the file niceguicrud-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: niceguicrud-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for niceguicrud-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 22be19a4b0a62ce0e4ea38dea4a31e459ba00cee0cec7c8e795079419f5debe1
MD5 375277cda7648f4d6be480423aa3b774
BLAKE2b-256 2a887104cea15eba3c7a6fcbc3a23c98b5ff5a2c52c694ff7483ee8c166a6775

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