imednet.core.endpoint package
Core endpoint abstractions and protocols.
- class imednet.core.endpoint.AsyncListGetEndpoint[source]
Bases:
_ListGetEndpointBase[T]- __init__(async_client, ctx=None)[source]
- Parameters:
async_client (AsyncRequestorProtocol) –
ctx (object | None) –
- Return type:
None
- class imednet.core.endpoint.EdcAsyncListGetEndpoint[source]
Bases:
_EdcEndpointBase,AsyncListGetEndpoint[T]Async EDC list/get endpoint base.
- BASE_PATH = '/api/v1/edc/studies'
- imednet.core.endpoint.EdcGenericListGetEndpoint
alias of
EdcSyncListGetEndpoint
- class imednet.core.endpoint.EdcSyncListGetEndpoint[source]
Bases:
_EdcEndpointBase,SyncListGetEndpoint[T]Sync EDC list/get endpoint base.
- BASE_PATH = '/api/v1/edc/studies'
- class imednet.core.endpoint.GenericEndpoint[source]
Bases:
EndpointABC[T]Generic base for endpoint wrappers.
Handles context injection and basic path building. Does NOT include EDC-specific logic.
- BASE_PATH = ''
- __init__(client=None, ctx=None, async_client=None)[source]
- Parameters:
client (RequestorProtocol | None) –
ctx (object | None) –
async_client (AsyncRequestorProtocol | None) –
- Return type:
None
- imednet.core.endpoint.GenericListGetEndpoint
alias of
SyncListGetEndpoint
- class imednet.core.endpoint.SupportsCreate[source]
Bases:
Protocol[T_co]Protocol for resources that support
createoperations.- __init__(*args, **kwargs)
- class imednet.core.endpoint.SupportsGet[source]
Bases:
Protocol[T_co]Protocol for resources that support
getoperations.- __init__(*args, **kwargs)
- class imednet.core.endpoint.SupportsList[source]
Bases:
Protocol[T_co]Protocol for resources that support
listoperations.- __init__(*args, **kwargs)
- class imednet.core.endpoint.SyncListGetEndpoint[source]
Bases:
_ListGetEndpointBase[T]- __init__(client, ctx=None)[source]
- Parameters:
client (RequestorProtocol) –
ctx (object | None) –
- Return type:
None
Subpackages
- imednet.core.endpoint.operations package
Submodules
imednet.core.endpoint.abc module
Abstract base class for all API endpoints.
- class imednet.core.endpoint.abc.EndpointABC[source]
Bases:
ABC,ClientProvider,Generic[T]Abstract base class defining the contract for all API endpoints.
This ensures that all endpoint implementations provide necessary properties like PATH and MODEL, and implement core path building logic.
- abstract property MODEL: Type[T]
The model class associated with this endpoint.
- abstract property PATH: str
The relative path for the endpoint.
-
requires_study_key:
bool= True Whether this endpoint requires a study key. Defaults to True. Override in subclasses if needed.
imednet.core.endpoint.base module
Base endpoint mix-in for all API resource endpoints.
- class imednet.core.endpoint.base.AsyncListGetEndpoint[source]
Bases:
_ListGetEndpointBase[T]- __init__(async_client, ctx=None)[source]
- Parameters:
async_client (AsyncRequestorProtocol) –
ctx (object | None) –
- Return type:
None
- class imednet.core.endpoint.base.GenericEndpoint[source]
Bases:
EndpointABC[T]Generic base for endpoint wrappers.
Handles context injection and basic path building. Does NOT include EDC-specific logic.
- BASE_PATH = ''
- __init__(client=None, ctx=None, async_client=None)[source]
- Parameters:
client (RequestorProtocol | None) –
ctx (object | None) –
async_client (AsyncRequestorProtocol | None) –
- Return type:
None
- imednet.core.endpoint.base.GenericListGetEndpoint
alias of
SyncListGetEndpoint
- class imednet.core.endpoint.base.SyncListGetEndpoint[source]
Bases:
_ListGetEndpointBase[T]- __init__(client, ctx=None)[source]
- Parameters:
client (RequestorProtocol) –
ctx (object | None) –
- Return type:
None
imednet.core.endpoint.edc_mixin module
EDC-specific endpoint base class and mixin.
- class imednet.core.endpoint.edc_mixin.EdcAsyncListGetEndpoint[source]
Bases:
_EdcEndpointBase,AsyncListGetEndpoint[T]Async EDC list/get endpoint base.
- BASE_PATH = '/api/v1/edc/studies'
- class imednet.core.endpoint.edc_mixin.EdcEndpointMixin[source]
Bases:
objectMixin providing EDC-specific logic for endpoints.
This includes the base path for EDC resources and automatic injection of the default study key into filters.
- BASE_PATH = '/api/v1/edc/studies'
- imednet.core.endpoint.edc_mixin.EdcGenericListGetEndpoint
alias of
EdcSyncListGetEndpoint
- class imednet.core.endpoint.edc_mixin.EdcSyncListGetEndpoint[source]
Bases:
_EdcEndpointBase,SyncListGetEndpoint[T]Sync EDC list/get endpoint base.
- BASE_PATH = '/api/v1/edc/studies'
imednet.core.endpoint.protocols module
- class imednet.core.endpoint.protocols.AsyncOperationProtocol[source]
Bases:
Protocol,Generic[T_co]Protocol for async operation executors requiring explicit transport injection.
Note
These operation protocols are intentionally generic extension points for future endpoint operation bindings.
- __init__(*args, **kwargs)
- class imednet.core.endpoint.protocols.EndpointProtocol[source]
Bases:
ProtocolProtocol defining the interface for endpoint classes.
-
PAGE_SIZE:
int
-
PATH:
str
- __init__(*args, **kwargs)
-
requires_study_key:
bool
-
PAGE_SIZE:
- class imednet.core.endpoint.protocols.ListEndpointProtocol[source]
Bases:
Protocol[T]Protocol defining the interface for listing endpoint classes.
- __init__(*args, **kwargs)
- class imednet.core.endpoint.protocols.SupportsCreate[source]
Bases:
Protocol[T_co]Protocol for resources that support
createoperations.- __init__(*args, **kwargs)
- class imednet.core.endpoint.protocols.SupportsGet[source]
Bases:
Protocol[T_co]Protocol for resources that support
getoperations.- __init__(*args, **kwargs)
- class imednet.core.endpoint.protocols.SupportsList[source]
Bases:
Protocol[T_co]Protocol for resources that support
listoperations.- __init__(*args, **kwargs)
- class imednet.core.endpoint.protocols.SyncOperationProtocol[source]
Bases:
Protocol,Generic[T_co]Protocol for sync operation executors requiring explicit transport injection.
Note
These operation protocols are intentionally generic extension points for future endpoint operation bindings.
- __init__(*args, **kwargs)
imednet.core.endpoint.strategies module
Parameter processing strategies for endpoints.
This module implements the ParamProcessor strategy pattern, allowing endpoints to customize how filters are processed and special parameters are extracted.
- class imednet.core.endpoint.strategies.DefaultParamProcessor[source]
Bases:
ParamProcessorDefault parameter processor.
Simply passes filters through without modification.
- class imednet.core.endpoint.strategies.KeepStudyKeyStrategy[source]
Bases:
objectStrategy that requires a study key and keeps it in the filters.
Used when the API expects ‘studyKey’ as a query parameter.
- class imednet.core.endpoint.strategies.MappingParamProcessor[source]
Bases:
ParamProcessorParamProcessor that maps specific filter keys to API parameters.
Extracts keys defined in the mapping and returns them as special parameters, optionally renaming them according to the mapping values.
- __init__(mapping, defaults=None)[source]
Initialize the processor with a mapping.
- Parameters:
mapping (
Dict[str,str]) – A dictionary where keys are the filter keys to look for, and values are the API parameter names to map them to.defaults (
Optional[Dict[str,Any]]) – A dictionary of default values for keys not found in filters.
- Return type:
None
- class imednet.core.endpoint.strategies.OptionalStudyKeyStrategy[source]
Bases:
objectStrategy that allows the study key to be optional.
If present, it is kept in the filters.
- class imednet.core.endpoint.strategies.PopStudyKeyStrategy[source]
Bases:
objectStrategy that requires a study key but removes it from the filters.
Used when the study key is part of the path or handled separately, not sent as a query parameter.
imednet.core.endpoint.structs module
- class imednet.core.endpoint.structs.ListRequestState[source]
Bases:
Generic[T]Encapsulates the state required to execute a list request.
- path
The API path for the request.
- params
The query parameters.
- study
The study key.
- __init__(path, params, study)
- Parameters:
path (str) –
params (Dict[str, Any]) –
study (str | None) –
- Return type:
None
-
params:
Dict[str,Any]
-
path:
str
-
study:
Optional[str]
- class imednet.core.endpoint.structs.ParamState[source]
Bases:
objectEncapsulates the state of resolved parameters for an endpoint request.
- study
The study key, if applicable.
- params
The dictionary of query parameters.
- other_filters
Remaining filters after study key extraction.
- __init__(study, params, other_filters)
- Parameters:
study (str | None) –
params (Dict[str, Any]) –
other_filters (Dict[str, Any]) –
- Return type:
None
-
other_filters:
Dict[str,Any]
-
params:
Dict[str,Any]
-
study:
Optional[str]