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, contraints, 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:
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!
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.6.tar.gz
(14.1 kB
view details)
Built Distribution
File details
Details for the file niceguicrud-0.1.6.tar.gz
.
File metadata
- Download URL: niceguicrud-0.1.6.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.10.1-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d0ab1023a1835f8b79bb97562039fd117a84403c9ba07e8f69f5e6950715c8c |
|
MD5 | 22fa05d790f958b4919e316e89f016b6 |
|
BLAKE2b-256 | aa9feda95836a4f8784e34b9d018b47b5f284f6e95d4c03024457bf34ea9c2b4 |
File details
Details for the file niceguicrud-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: niceguicrud-0.1.6-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.10.1-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8230a8a492419d9a85fc4f7fecd600e67b1c92d88d149489d7af7e77fc76a16 |
|
MD5 | 28ebaf8d910ca3131f14f2c7dd7bdcf5 |
|
BLAKE2b-256 | 2ad73835b9ecef3e6b0c16bff916029e1e42fe06691db0379cca748894c363dc |