Skip to main content

xladmin-import-export backend

Optional backend extension for xladmin that adds import/export endpoints.

Features

  • export json, csv, xlsx
  • import json, csv, xlsx
  • export custom readable fields, including custom list_display fields
  • import validation before commit
  • PK conflict modes: auto_generate_pk, update_existing, skip_existing
  • UUID primary key auto-generation on import

Install

pip install xladmin xladmin-import-export

Minimal Example

from fastapi import APIRouter
from xladmin import HttpConfig, create_router
from xladmin_import_export import ImportExportConfig, create_import_export_router

router = APIRouter()
router.include_router(create_router(http_config))
router.include_router(create_import_export_router(http_config))

user_model = ModelConfig(
    model=UserORM,
    slug="users",
    import_export=ImportExportConfig(),
)

# OR

user_model = ModelConfig(
    model=UserORM,
    slug="users",
    import_export=ImportExportConfig(
        export_fields=("id", "email", "roles"),
        import_fields=("id", "email", "roles"),
    ),
)

Endpoints

  • GET /xladmin/models/{slug}/import-export/meta/
  • POST /xladmin/models/{slug}/export/
  • POST /xladmin/models/{slug}/import/validate/
  • POST /xladmin/models/{slug}/import/commit/

Development

cd xladmin-backend/xladmin-import-export
uv sync --extra dev
uv run pytest -q
uv run ruff check .
uv run mypy
uv run python -m build

Docs

Release files for xladmin-import-export 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xladmin-import-export 0.1.2
File Size Uploaded
xladmin_import_export-0.1.2.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xladmin-import-export 0.1.2
File Interpreter ABI Platform
xladmin_import_export-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / xladmin_import_export-0.1.2.tar.gz

Download URL xladmin_import_export-0.1.2.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0ff8b7dd2c92d0905b2e7840c9776f738b66757ba64ead0902a427f31d5e508f
BLAKE2b-256 checksum
How to use checksums
01e4dcfab4c173c1db7c68d6b09a733a5c62a390ea8c24daeb6d72b3c77c0883
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / xladmin_import_export-0.1.2-py3-none-any.whl

Download URL xladmin_import_export-0.1.2-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
154fa9f60587a179d69525ba01ae42828b9cbb68d203bb3e70eac3ec9001bffe
BLAKE2b-256 checksum
How to use checksums
7d9cf9a0fc99d01784bfbbcee0fd4db34a7a5b02041fb3f46269201f394f90c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

0.2.0

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page