niceguicrud


Nameniceguicrud JSON
Version 0.1.6 PyPI version JSON
download
home_pageNone
SummaryEdit your pydantic models with a nice GUI - CRUD Create Update Replace Delete
upload_time2024-07-31 00:40:06
maintainerNone
docs_urlNone
authorDronakurl
requires_python<4.0,>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # NiceCRUD

NiceCRUD is a CRUD (Create, Read, Update, Delete) interface built with python. The library integrates with pydantic models and [NiceGUI](https://nicegui.io) 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](/examples/input_choices.py) example:

![CRUD Interface Screenshot - Grid of objects](/examples/input_choices.png)
![CRUD Interface Screenshot - Editing objects](/examples/input_choices_add.png)

## Installation

To install NiceCRUD, use pip:

<!-- pip install 'git+https://github.com/Dronakurl/nicecrud.git'-->

```bash
pip install niceguicrud
```

## Quick Start

Here is a very basic example:

```python

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](/examples) folder.
| Example Name    | Description                             |
|-----------------|-----------------------------------------|
| [minimal](/examples/minimal.py)         | The above minimal example |
| [validation](/examples/validation.py)      | Example showcasing how pydantic validation features are used in the GUI |
| [submodel](/examples/submodel.py)        | Demonstrates usage of a pydantic submodel that can also be used in the GUI.        |
| [input_choices](/examples/input_choices.py)   | Shows the different input choices.   |
| [database](/examples/database.py)   | 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](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "niceguicrud",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Dronakurl",
    "author_email": "tbo73oij5@mozmail.com",
    "download_url": "https://files.pythonhosted.org/packages/aa/9f/eda95836a4f8784e34b9d018b47b5f284f6e95d4c03024457bf34ea9c2b4/niceguicrud-0.1.6.tar.gz",
    "platform": null,
    "description": "# NiceCRUD\n\nNiceCRUD is a CRUD (Create, Read, Update, Delete) interface built with python. The library integrates with pydantic models and [NiceGUI](https://nicegui.io) to handle data manipulation with a browser interface.\n\n## Features\n\n- Automatically generate CRUD interfaces from pydantic models.\n- Field options, ranges, contraints, descriptions etc. are directly taken from your pydantic model\n- Integrated validation and error handling with pydantic.\n- Support for nested models and selection options.\n- Inject your own (database?) update methods\n- Minimal configuration required with sensible defaults.\n\n## Screenshots\n\nTaken from the [input_choices](/examples/input_choices.py) example:\n\n![CRUD Interface Screenshot - Grid of objects](/examples/input_choices.png)\n![CRUD Interface Screenshot - Editing objects](/examples/input_choices_add.png)\n\n## Installation\n\nTo install NiceCRUD, use pip:\n\n<!-- pip install 'git+https://github.com/Dronakurl/nicecrud.git'-->\n\n```bash\npip install niceguicrud\n```\n\n## Quick Start\n\nHere is a very basic example:\n\n```python\n\nfrom nicegui import ui\nfrom pydantic import BaseModel, Field\n\nfrom niceguicrud import NiceCRUD\n\n\nclass MyModel(BaseModel, title=\"User\"):\n    id: int\n    name: str = Field(title=\"Name\")\n    age: int = Field(gt=0, title=\"Age\")\n\n\ninstance1 = MyModel(id=1, name=\"Alice\", age=30)\ninstance2 = MyModel(id=2, name=\"Bob\", age=25)\ncrud_app = NiceCRUD(basemodels=[instance1, instance2], id_field=\"id\", heading=\"User Management\")\n\nui.run()\n```\n\nFind more in the [examples](/examples) folder.\n| Example Name    | Description                             |\n|-----------------|-----------------------------------------|\n| [minimal](/examples/minimal.py)         | The above minimal example |\n| [validation](/examples/validation.py)      | Example showcasing how pydantic validation features are used in the GUI |\n| [submodel](/examples/submodel.py)        | Demonstrates usage of a pydantic submodel that can also be used in the GUI.        |\n| [input_choices](/examples/input_choices.py)   | Shows the different input choices.   |\n| [database](/examples/database.py)   | Shows how to customize the update, create and delete operations |\n\n## Contributing\n\nContributions are welcome!\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Edit your pydantic models with a nice GUI - CRUD Create Update Replace Delete",
    "version": "0.1.6",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ad73835b9ecef3e6b0c16bff916029e1e42fe06691db0379cca748894c363dc",
                "md5": "28ebaf8d910ca3131f14f2c7dd7bdcf5",
                "sha256": "f8230a8a492419d9a85fc4f7fecd600e67b1c92d88d149489d7af7e77fc76a16"
            },
            "downloads": -1,
            "filename": "niceguicrud-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "28ebaf8d910ca3131f14f2c7dd7bdcf5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 14169,
            "upload_time": "2024-07-31T00:40:05",
            "upload_time_iso_8601": "2024-07-31T00:40:05.185408Z",
            "url": "https://files.pythonhosted.org/packages/2a/d7/3835b9ecef3e6b0c16bff916029e1e42fe06691db0379cca748894c363dc/niceguicrud-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa9feda95836a4f8784e34b9d018b47b5f284f6e95d4c03024457bf34ea9c2b4",
                "md5": "22fa05d790f958b4919e316e89f016b6",
                "sha256": "9d0ab1023a1835f8b79bb97562039fd117a84403c9ba07e8f69f5e6950715c8c"
            },
            "downloads": -1,
            "filename": "niceguicrud-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "22fa05d790f958b4919e316e89f016b6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 14059,
            "upload_time": "2024-07-31T00:40:06",
            "upload_time_iso_8601": "2024-07-31T00:40:06.822031Z",
            "url": "https://files.pythonhosted.org/packages/aa/9f/eda95836a4f8784e34b9d018b47b5f284f6e95d4c03024457bf34ea9c2b4/niceguicrud-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-31 00:40:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "niceguicrud"
}
        
Elapsed time: 0.24881s