imednet package

The main SDK classes are available directly from the package root:

from imednet import ImednetSDK, AsyncImednetSDK

Subpackages

Submodules

imednet.sdk module

Public entry-point for the iMednet SDK.

This module provides the ImednetSDK class which: - Manages configuration and authentication - Exposes all endpoint functionality through a unified interface - Provides context management for proper resource cleanup

class imednet.sdk.AsyncImednetSDK(*args, **kwargs)[source]

Bases: ImednetSDK

Async variant of ImednetSDK using the async HTTP client.

Parameters:
  • args (Any) –

  • kwargs (Any) –

class imednet.sdk.ImednetSDK(api_key=None, security_key=None, base_url=None, timeout=30.0, retries=3, backoff_factor=1.0, retry_policy=None, enable_async=False)[source]

Bases: object

Public entry-point for library users.

Provides access to all iMednet API endpoints and maintains configuration.

Parameters:
  • api_key (Optional[str]) –

  • security_key (Optional[str]) –

  • base_url (Optional[str]) –

  • timeout (float) –

  • retries (int) –

  • backoff_factor (float) –

  • retry_policy (RetryPolicy | None) –

  • enable_async (bool) –

ctx

Context object for storing state across SDK calls.

etc...
async aclose()[source]
Return type:

None

async async_poll_job(study_key, batch_id, *, interval=5, timeout=300)[source]

Asynchronously poll a job until it reaches a terminal state.

Return type:

JobStatus

Parameters:
  • study_key (str) –

  • batch_id (str) –

  • interval (int) –

  • timeout (int) –

clear_default_study()[source]

Clear the default study key.

Return type:

None

close()[source]

Close the client connection and free resources.

Return type:

None

codings: CodingsEndpoint
config: Config
create_record(study_key, records_data, email_notify=None)[source]

Create records in the specified study.

Return type:

Job

Parameters:
  • study_key (str) –

  • records_data (List[Dict[str, Any]]) –

  • email_notify (bool | str | None) –

forms: FormsEndpoint
get_codings(study_key, **filters)[source]

Return codings for the specified study.

Return type:

List[Coding]

Parameters:
  • study_key (str) –

  • filters (Any) –

get_forms(study_key, **filters)[source]

Return forms for the specified study.

Return type:

List[Form]

Parameters:
  • study_key (str) –

  • filters (Any) –

get_intervals(study_key, **filters)[source]

Return intervals for the specified study.

Return type:

List[Interval]

Parameters:
  • study_key (str) –

  • filters (Any) –

get_job(study_key, batch_id)[source]

Return job details for the specified batch.

Return type:

JobStatus

Parameters:
  • study_key (str) –

  • batch_id (str) –

get_queries(study_key, **filters)[source]

Return queries for the specified study.

Return type:

List[Query]

Parameters:
  • study_key (str) –

  • filters (Any) –

get_record_revisions(study_key, **filters)[source]

Return record revisions for the specified study.

Return type:

List[RecordRevision]

Parameters:
  • study_key (str) –

  • filters (Any) –

get_records(study_key, record_data_filter=None, **filters)[source]

Return records for the specified study.

Return type:

List[Record]

Parameters:
  • study_key (str) –

  • record_data_filter (str | None) –

  • filters (Any) –

get_sites(study_key, **filters)[source]

Return sites for the specified study.

Return type:

List[Site]

Parameters:
  • study_key (str) –

  • filters (Any) –

get_studies(**filters)[source]

Return all studies accessible by the current API key.

Return type:

List[Study]

Parameters:

filters (Any) –

get_subjects(study_key, **filters)[source]

Return subjects for the specified study.

Return type:

List[Subject]

Parameters:
  • study_key (str) –

  • filters (Any) –

get_users(study_key, include_inactive=False)[source]

Return users for the specified study.

Return type:

List[User]

Parameters:
  • study_key (str) –

  • include_inactive (bool) –

get_variables(study_key, **filters)[source]

Return variables for the specified study.

Return type:

List[Variable]

Parameters:
  • study_key (str) –

  • filters (Any) –

get_visits(study_key, **filters)[source]

Return visits for the specified study.

Return type:

List[Visit]

Parameters:
  • study_key (str) –

  • filters (Any) –

intervals: IntervalsEndpoint
jobs: JobsEndpoint
poll_job(study_key, batch_id, *, interval=5, timeout=300)[source]

Poll a job until it reaches a terminal state.

Return type:

JobStatus

Parameters:
  • study_key (str) –

  • batch_id (str) –

  • interval (int) –

  • timeout (int) –

queries: QueriesEndpoint
record_revisions: RecordRevisionsEndpoint
records: RecordsEndpoint
property retry_policy: RetryPolicy
set_default_study(study_key)[source]

Set the default study key for subsequent API calls.

Parameters:

study_key (str) – The study key to use as default.

Return type:

None

sites: SitesEndpoint
studies: StudiesEndpoint
subjects: SubjectsEndpoint
users: UsersEndpoint
variables: VariablesEndpoint
visits: VisitsEndpoint

imednet.async_sdk module

imednet.discovery module

Runtime discovery utilities for live tests and scripts.

exception imednet.discovery.NoLiveDataError[source]

Bases: RuntimeError

Raised when required live data cannot be found.

imednet.discovery.discover_form_key(sdk, study_key)[source]

Return the first subject record form key for study_key.

Return type:

str

Parameters:
imednet.discovery.discover_interval_name(sdk, study_key)[source]

Return the first non-disabled interval name for study_key.

Return type:

str

Parameters:
imednet.discovery.discover_site_name(sdk, study_key)[source]

Return the first active site name for study_key.

Return type:

str

Parameters:
imednet.discovery.discover_study_key(sdk)[source]

Return the first study key available for the provided SDK.

Return type:

str

Parameters:

sdk (ImednetSDK) –

imednet.discovery.discover_subject_key(sdk, study_key)[source]

Return the first active subject key for study_key.

Return type:

str

Parameters: