django-import-export-extensions


Namedjango-import-export-extensions JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/saritasa-nest/django-import-export-extensions
SummaryExtend functionality of `django-import-export`
upload_time2024-11-08 11:03:05
maintainerNikita Azanov
docs_urlNone
authorSaritasa
requires_python<4.0,>=3.10
licenseMIT
keywords python json django csv xlsx celery import_export django_import_export_extensions
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Django-import-export-extensions

[![PyPI - Python Versions](https://img.shields.io/pypi/pyversions/django-import-export-extensions)](https://pypi.org/project/django-import-export-extensions/)
[![PyPI - Django Versions](https://img.shields.io/pypi/frameworkversions/django/django-import-export-extensions)](https://pypi.org/project/django-import-export-extensions/)
![PyPI](https://img.shields.io/pypi/v/django-import-export-extensions)

[![Build status on Github](https://github.com/saritasa-nest/django-import-export-extensions/actions/workflows/checks.yml/badge.svg)](https://github.com/saritasa-nest/django-import-export-extensions/actions/workflows/checks.yml)
[![Test coverage](https://coveralls.io/repos/github/saritasa-nest/django-import-export-extensions/badge.svg?branch=main)](https://coveralls.io/github/saritasa-nest/django-import-export-extensions?branch=main)
[![Documentation Status](https://readthedocs.org/projects/django-import-export-extensions/badge/?version=latest)](https://django-import-export-extensions.readthedocs.io/en/latest/?badge=latest)

 ![PyPI Downloads](https://static.pepy.tech/badge/django-import-export-extensions/month)

## Links

- [Documentation](<https://django-import-export-extensions.readthedocs.io>)
- [GitHub](<https://github.com/saritasa-nest/django-import-export-extensions>)
- [PyPI](<https://pypi.org/project/django-import-export-extensions>)
- [Contibuting](<https://django-import-export-extensions.readthedocs.io/en/stable/contributing.html>)
- [History](https://django-import-export-extensions.readthedocs.io/en/stable/history.html)

## Description

`django-import-export-extensions` extends the functionality of
[django-import-export](https://github.com/django-import-export/django-import-export/)
adding the following features:

- Import/export resources in the background via Celery
- Manage import/export jobs via Django Admin
- DRF integration that allows to work with import/export jobs via API
- Support [drf-spectacular](https://github.com/tfranzel/drf-spectacular) generated API schema
- Additional fields and widgets (FileWidget, IntermediateManyToManyWidget, IntermediateManyToManyField)

## Installation

To install `django-import-export-extensions`, run this command in your
terminal:

```sh
pip install django-import-export-extensions
```

Add `import_export` and `import_export_extensions` to `INSTALLED_APPS`

```python
# settings.py
INSTALLED_APPS = (
    ...,
    "import_export",
    "import_export_extensions",
)
```

Run `migrate` command to create ImportJob/ExportJob models and
`collectstatic` to let Django collect package static files to use in the
admin.

```sh
python manage.py migrate
python manage.py collectstatic
```

## Usage

Prepare resource for your model

```python
# apps/books/resources.py
from import_export_extensions.resources import CeleryModelResource

from .. import models


class BookResource(CeleryModelResource):

    class Meta:
        model = models.Book
```

Use `CeleryImportExportMixin` class and set `resource_classes` in admin
model to import/export via Django Admin

```python
# apps/books/admin.py
from django.contrib import admin

from import_export_extensions.admin import CeleryImportExportMixin

from .. import resources


@admin.register(models.Book)
class BookAdmin(CeleryImportExportMixin, admin.ModelAdmin):
    resource_class = resources.BookResource
```

Prepare view sets to import/export via API

``` python
# apps/books/api/views.py
from .. import resources

from import_export_extensions.api import views


class BookExportViewSet(views.ExportJobViewSet):
    resource_class = resources.BookResource


class BookImportViewSet(views.ImportJobViewSet):
    resource_class = resources.BookResource
```

Don't forget to [configure
Celery](https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html)
if you want to run import/export in background

## License

- Free software: MIT license

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/saritasa-nest/django-import-export-extensions",
    "name": "django-import-export-extensions",
    "maintainer": "Nikita Azanov",
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": "nikita.azanov@saritasa.com",
    "keywords": "python, json, django, csv, xlsx, celery, import_export, django_import_export_extensions",
    "author": "Saritasa",
    "author_email": "pypi@saritasa.com",
    "download_url": "https://files.pythonhosted.org/packages/65/4a/f8ef417b26f6ab3ca9d07f6b0e4a34f2a5c006eb2107623cb6ff79c2480c/django_import_export_extensions-1.0.1.tar.gz",
    "platform": null,
    "description": "# Django-import-export-extensions\n\n[![PyPI - Python Versions](https://img.shields.io/pypi/pyversions/django-import-export-extensions)](https://pypi.org/project/django-import-export-extensions/)\n[![PyPI - Django Versions](https://img.shields.io/pypi/frameworkversions/django/django-import-export-extensions)](https://pypi.org/project/django-import-export-extensions/)\n![PyPI](https://img.shields.io/pypi/v/django-import-export-extensions)\n\n[![Build status on Github](https://github.com/saritasa-nest/django-import-export-extensions/actions/workflows/checks.yml/badge.svg)](https://github.com/saritasa-nest/django-import-export-extensions/actions/workflows/checks.yml)\n[![Test coverage](https://coveralls.io/repos/github/saritasa-nest/django-import-export-extensions/badge.svg?branch=main)](https://coveralls.io/github/saritasa-nest/django-import-export-extensions?branch=main)\n[![Documentation Status](https://readthedocs.org/projects/django-import-export-extensions/badge/?version=latest)](https://django-import-export-extensions.readthedocs.io/en/latest/?badge=latest)\n\n ![PyPI Downloads](https://static.pepy.tech/badge/django-import-export-extensions/month)\n\n## Links\n\n- [Documentation](<https://django-import-export-extensions.readthedocs.io>)\n- [GitHub](<https://github.com/saritasa-nest/django-import-export-extensions>)\n- [PyPI](<https://pypi.org/project/django-import-export-extensions>)\n- [Contibuting](<https://django-import-export-extensions.readthedocs.io/en/stable/contributing.html>)\n- [History](https://django-import-export-extensions.readthedocs.io/en/stable/history.html)\n\n## Description\n\n`django-import-export-extensions` extends the functionality of\n[django-import-export](https://github.com/django-import-export/django-import-export/)\nadding the following features:\n\n- Import/export resources in the background via Celery\n- Manage import/export jobs via Django Admin\n- DRF integration that allows to work with import/export jobs via API\n- Support [drf-spectacular](https://github.com/tfranzel/drf-spectacular) generated API schema\n- Additional fields and widgets (FileWidget, IntermediateManyToManyWidget, IntermediateManyToManyField)\n\n## Installation\n\nTo install `django-import-export-extensions`, run this command in your\nterminal:\n\n```sh\npip install django-import-export-extensions\n```\n\nAdd `import_export` and `import_export_extensions` to `INSTALLED_APPS`\n\n```python\n# settings.py\nINSTALLED_APPS = (\n    ...,\n    \"import_export\",\n    \"import_export_extensions\",\n)\n```\n\nRun `migrate` command to create ImportJob/ExportJob models and\n`collectstatic` to let Django collect package static files to use in the\nadmin.\n\n```sh\npython manage.py migrate\npython manage.py collectstatic\n```\n\n## Usage\n\nPrepare resource for your model\n\n```python\n# apps/books/resources.py\nfrom import_export_extensions.resources import CeleryModelResource\n\nfrom .. import models\n\n\nclass BookResource(CeleryModelResource):\n\n    class Meta:\n        model = models.Book\n```\n\nUse `CeleryImportExportMixin` class and set `resource_classes` in admin\nmodel to import/export via Django Admin\n\n```python\n# apps/books/admin.py\nfrom django.contrib import admin\n\nfrom import_export_extensions.admin import CeleryImportExportMixin\n\nfrom .. import resources\n\n\n@admin.register(models.Book)\nclass BookAdmin(CeleryImportExportMixin, admin.ModelAdmin):\n    resource_class = resources.BookResource\n```\n\nPrepare view sets to import/export via API\n\n``` python\n# apps/books/api/views.py\nfrom .. import resources\n\nfrom import_export_extensions.api import views\n\n\nclass BookExportViewSet(views.ExportJobViewSet):\n    resource_class = resources.BookResource\n\n\nclass BookImportViewSet(views.ImportJobViewSet):\n    resource_class = resources.BookResource\n```\n\nDon't forget to [configure\nCelery](https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html)\nif you want to run import/export in background\n\n## License\n\n- Free software: MIT license\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Extend functionality of `django-import-export`",
    "version": "1.0.1",
    "project_urls": {
        "Documentation": "https://django-import-export-extensions.readthedocs.io",
        "Homepage": "https://github.com/saritasa-nest/django-import-export-extensions",
        "Repository": "https://github.com/saritasa-nest/django-import-export-extensions"
    },
    "split_keywords": [
        "python",
        " json",
        " django",
        " csv",
        " xlsx",
        " celery",
        " import_export",
        " django_import_export_extensions"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8d524eef5d4143201551ea548aa622f7e5853acd1c090bd349653eb893ae48a4",
                "md5": "84527b160a5b98e18eb97ae07a831a85",
                "sha256": "3e720d26ecd1219ecf1a7df7aa794a02fc63fb5606f55e37947b5028fc6964f0"
            },
            "downloads": -1,
            "filename": "django_import_export_extensions-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "84527b160a5b98e18eb97ae07a831a85",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 67491,
            "upload_time": "2024-11-08T11:03:03",
            "upload_time_iso_8601": "2024-11-08T11:03:03.544998Z",
            "url": "https://files.pythonhosted.org/packages/8d/52/4eef5d4143201551ea548aa622f7e5853acd1c090bd349653eb893ae48a4/django_import_export_extensions-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "654af8ef417b26f6ab3ca9d07f6b0e4a34f2a5c006eb2107623cb6ff79c2480c",
                "md5": "0e90d45971609842cc7f47b68556cf0c",
                "sha256": "d2a6962230d1bf595973bf8242f5f896d1fa8dacf2360e58919bc196bbd45eb2"
            },
            "downloads": -1,
            "filename": "django_import_export_extensions-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0e90d45971609842cc7f47b68556cf0c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 45315,
            "upload_time": "2024-11-08T11:03:05",
            "upload_time_iso_8601": "2024-11-08T11:03:05.303610Z",
            "url": "https://files.pythonhosted.org/packages/65/4a/f8ef417b26f6ab3ca9d07f6b0e4a34f2a5c006eb2107623cb6ff79c2480c/django_import_export_extensions-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-08 11:03:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "saritasa-nest",
    "github_project": "django-import-export-extensions",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "django-import-export-extensions"
}
        
Elapsed time: 0.36201s