dataenginex.api
API helper components — schemas, errors, and pagination.
These are building blocks for applications that expose an HTTP layer on top of dataenginex (e.g. a FastAPI server). They have no dependency on any web framework and can be imported without extras.
Public API::
from dataenginex.api import (
BadRequestError, NotFoundError, ServiceUnavailableError,
PaginatedResponse, paginate,
)
from dataenginex.api.schemas import PipelineResultResponse, PredictionRequest, ...
BadRequestError
Bases: DexAPIError
Invalid input or malformed request.
Source code in src/dataenginex/api/errors.py
25 26 27 28 29 | |
DexAPIError
Bases: Exception
Base error for dataenginex API operations.
Source code in src/dataenginex/api/errors.py
17 18 19 20 21 22 | |
NotFoundError
Bases: DexAPIError
Requested resource does not exist.
Source code in src/dataenginex/api/errors.py
32 33 34 35 36 | |
ServiceUnavailableError
Bases: DexAPIError
A required dependency is unavailable.
Source code in src/dataenginex/api/errors.py
39 40 41 42 43 | |
PaginatedResponse
Bases: BaseModel
Generic paginated response wrapper.
Source code in src/dataenginex/api/pagination.py
43 44 45 46 47 | |
PaginationMeta
Bases: BaseModel
Pagination metadata returned alongside results.
Source code in src/dataenginex/api/pagination.py
33 34 35 36 37 38 39 40 | |
paginate(items, *, cursor=None, limit=20, max_limit=100)
Slice items and return a PaginatedResponse.
Parameters
items: Full list of items to paginate. cursor: Opaque cursor from a previous response (or None for the first page). limit: Number of items per page. max_limit: Hard ceiling on limit to prevent abuse.
Source code in src/dataenginex/api/pagination.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |