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_displayfields - 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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xladmin_import_export-0.1.3.tar.gz | 13.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xladmin_import_export-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.8 kB
Release files / xladmin_import_export-0.1.3.tar.gz
| Download URL | xladmin_import_export-0.1.3.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82710546df5e934c34eb55836416a248971e6f387aeb79dc935d206139b54c0d
|
|
BLAKE2b-256 checksum How to use checksums |
bc0b5234293a465b2fa620047c55290dba39811fa778c802602270f33d45780d
|
| 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.3-py3-none-any.whl
| Download URL | xladmin_import_export-0.1.3-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b96d98949f45d40544a9b61043c2f14b8eeb51ea19e1393f0590cbb4a821eb75
|
|
BLAKE2b-256 checksum How to use checksums |
b035042ea87c9c3269c90fcbe940bc9552158a1c1b2b5b585043bacd814c6f85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|