Metadata-Version: 2.4
Name: habarico
Version: 7.3.0b13
Summary: Habarico REST admin Django library
Author-email: Luboš Mátl <lubos.matl@eluvia.com>
License: MIT License
        
        Copyright (c) 2024 Eluvia.land s.r.o.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Documentation, https://docs.habarico.com/python/intro
Project-URL: Source Code, https://github.com/eluvia-com/habarico
Project-URL: Changelog, https://github.com/eluvia-com/habarico/blob/master/python/CHANGELOG.md
Keywords: package,django,admin,eluvia,habarico
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: eluvia-base>=2.0.0
Requires-Dist: eluvia-base-django>=2.3.2
Requires-Dist: djangorestframework>=3.14
Requires-Dist: django>=3.0.0
Requires-Dist: django-filter>=23.1
Requires-Dist: django-phonenumber-field[phonenumbers]>=7.1.0
Requires-Dist: python-dateutil>=2.9.0
Requires-Dist: drf-extra-fields>=3.4.0
Requires-Dist: jsonschema>=4.0.0
Requires-Dist: pydantic<3,>=2
Provides-Extra: export-xlsx
Requires-Dist: openpyxl>=3.1; extra == "export-xlsx"
Dynamic: license-file

# habarico

Habarico is a schema-driven admin library for Django REST Framework. It turns Django models into a
complete admin API: REST endpoints plus JSON schemas describing resources, fields, views and
actions. The [React frontend](https://docs.habarico.com/node/intro) renders the whole admin UI from
those schemas — no screen is written per resource.

## Installation

```bash
pip install habarico
```

Add the app to `INSTALLED_APPS`:

```python
INSTALLED_APPS = [
    ...,
    "phonenumber_field",  # required for phone number field localization
    "habarico",
    "rest_framework",  # after habarico, which overrides its localization
    ...
]
```

And mount the admin site in `urls.py`:

```python
from django.urls import include, path
from habarico import site

urlpatterns = [
    path("admin/", include(site.urls)),
]
```

## Quick start

```python
# admin.py
from habarico import ModelAdmin

from .models import Product


class ProductAdmin(ModelAdmin):
    model = Product
    fields = ["name", "sku", "description", "status", "category", "price", "stock"]
    read_only_fields = ["created_at"]
    search_fields = ["name", "description"]
    filter_fields = ["status", "category", "price"]
    ordering_fields = ["name", "price"]
    can_create = True
    can_update = True
```

Importing the module registers the admin — that is a full CRUD resource: a list with filters and
sorting, a detail page, a create and an edit form.

## Documentation

Full documentation is at **[docs.habarico.com/python](https://docs.habarico.com/python/intro)** —
this file is only a quick start.

| Section | What it covers |
| --- | --- |
| [Installation](https://docs.habarico.com/python/installation) and [configuration](https://docs.habarico.com/python/configuration) | Settings, permissions and authentication classes |
| [Basic usage](https://docs.habarico.com/python/basic-usage/) | Fields, permissions, custom serializers and viewsets, configuration validation |
| [View generators](https://docs.habarico.com/python/view-generators/) | Shaping the list, detail and form views |
| [Filtering and searching](https://docs.habarico.com/python/filtering-and-searching/) | Filters, ordering and fulltext search |
| [Aggregations](https://docs.habarico.com/python/aggregations/) and [dashboard](https://docs.habarico.com/python/dashboard) | The `/aggregate` endpoint and the widgets built on it |
| [Chunked uploads](https://docs.habarico.com/python/chunked-uploads/) | Large files over TUS or S3 multipart |
| [AI integration](https://docs.habarico.com/python/ai-integration/) | Predictive fields and the assistant endpoints |
| [User preferences](https://docs.habarico.com/python/user-preferences/) | The per-user preference store the frontend syncs to |
| [Complete example](https://docs.habarico.com/python/complete-example) | One resource wired up end to end |

The frontend consuming these schemas is documented at
[docs.habarico.com/node](https://docs.habarico.com/node/intro), and the contract between them is
the [API reference](https://docs.habarico.com/api).

## License

[MIT](LICENSE)
