https://github.com/fderuiter/imednet-python-sdk

A Unofficial Python SDK that makes it easy to work with the iMednet REST API from your code or the command line. Manage studies, subjects, records, and more with a "friendly" interface. No need to worry about the low-level details.

https://github.com/fderuiter/imednet-python-sdk

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.4%) to scientific vocabulary

Keywords

api automation clinical clinical-trials data-integration edc healthcare imednet python research sdk
Last synced: 5 months ago · JSON representation

Repository

A Unofficial Python SDK that makes it easy to work with the iMednet REST API from your code or the command line. Manage studies, subjects, records, and more with a "friendly" interface. No need to worry about the low-level details.

Basic Info
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 2
  • Releases: 4
Topics
api automation clinical clinical-trials data-integration edc healthcare imednet python research sdk
Created 10 months ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Security Agents

README.md

imednet

imednet logo
**Unofficial Python SDK for the iMednet clinical trials API.** Full documentation:
[![PyPI](https://img.shields.io/pypi/v/imednet.svg)](https://pypi.org/project/imednet/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/imednet.svg)](https://pypi.org/project/imednet/) [![PyPI - Wheel](https://img.shields.io/pypi/wheel/imednet.svg)](https://pypi.org/project/imednet/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/imednet.svg)](https://pypi.org/project/imednet/) [![License](https://img.shields.io/pypi/l/imednet.svg)](LICENSE) [![CI](https://img.shields.io/github/actions/workflow/status/fderuiter/imednet-python-sdk/ci.yml?branch=main)](https://github.com/fderuiter/imednet-python-sdk/actions/workflows/ci.yml) [![Coverage](https://img.shields.io/badge/coverage-90%25-brightgreen)](https://github.com/fderuiter/imednet-python-sdk)

This package simplifies integration with the iMednet REST API for clinical trial management. It provides typed endpoint wrappers, helper workflows and a CLI so researchers and developers can automate data extraction and submission without reimplementing HTTP logic.

Features

  • Simple, consistent interface for API calls
  • Automatic pagination across endpoints
  • Pydantic models for requests and responses
  • Workflow helpers for data extraction and mapping
  • Pandas and CSV utilities
  • Optional in-memory caching of study metadata
  • Structured JSON logging and OpenTelemetry tracing
  • Async client and command line interface

Architecture

The SDK is organized around a core HTTP client layer, endpoint wrappers that model the iMednet API, workflow helpers that combine multiple endpoint calls, and a CLI built on top of those pieces.

mermaid graph TD CLI[CLI] --> |invokes| Workflows Workflows --> |coordinate| Endpoints Endpoints --> |use| Client["(HTTP Client)"] Client --> |requests| API


Installation

```bash

PyPI release

pip install imednet

Dev version

pip install git+https://github.com/fderuiter/imednet-python-sdk.git@main ```


Quick Start

Synchronous Example

```python from imednet import ImednetSDK, loadconfig from imednet.utils import configurejson_logging

configurejsonlogging() cfg = loadconfig() sdk = ImednetSDK( apikey=cfg.apikey, securitykey=cfg.securitykey, baseurl=cfg.base_url, ) print(sdk.studies.list()) ```

Asynchronous Example

```python import asyncio from imednet import AsyncImednetSDK, loadconfig from imednet.utils import configurejson_logging

async def main() -> None: configurejsonlogging() cfg = loadconfig() async with AsyncImednetSDK( apikey=cfg.apikey, securitykey=cfg.securitykey, baseurl=cfg.baseurl, ) as sdk: print(await sdk.studies.asynclist())

asyncio.run(main()) ```

See docs/asyncquickstart.rst for more details.


Configuration

The SDK and CLI read credentials from environment variables such as IMEDNET_API_KEY and IMEDNET_SECURITY_KEY. See configuration for the complete list, optional settings, and .env support. Use imednet.config.load_config() to access these values in your code.


CLI Usage

The package installs an imednet command with subcommands for studies, sites, subjects, records, jobs, queries and more. Use imednet --help to explore all options.

Example of exporting a subset of variables:

bash imednet export sql MY_STUDY table sqlite:///data.db --vars AGE,SEX --forms 10,20

When the connection string uses SQLite, the command splits the output into one table per form to avoid the 2000 column limit. Pass --single-table to disable this behaviour. See docs/cli.rst for full examples.


Documentation & Resources


Development & Contributing

Tech Stack

  • Python 3.10–3.12
  • requests, httpx, pydantic, typer, tenacity, python-dotenv

Project Structure

. ├── docs/ - Sphinx documentation ├── examples/ - Usage samples ├── imednet/ - SDK package ├── scripts/ - Helper scripts └── tests/ - Unit and integration tests

Testing & Development

bash ./scripts/setup.sh # once poetry run ruff check --fix . poetry run black --check . poetry run isort --check --profile black . poetry run mypy imednet poetry run pytest -q

After running tests, validate documentation builds cleanly (no warnings):

bash make docs

See docs/AGENTS.md for full documentation guidelines.

Smoke-test workflow

The optional smoke.yml action runs the tests/live suite. It relies on repository secrets APIKEY and SECURITYKEY and sets IMEDNET_RUN_E2E. Use the workflow to confirm real API access on demand or via its nightly schedule. INFO-level log messages stream to the terminal during these runs, making it easier to debug failures.

Building & Publishing

bash python -m build python -m twine upload dist/*

Pushing a Git tag like v0.1.4 triggers the GitHub Actions workflow that builds and publishes the package to PyPI.

Versioning & Changelog

This project follows Semantic Versioning. See CHANGELOG.md for release history.

Contributing

Contributions are welcome! See the contributing guide and CONTRIBUTING.md for full details.


License

This project is licensed under the MIT license. See LICENSE for details.


Acknowledgements

Built with open source libraries including requests, httpx, pydantic and typer.

Owner

  • Name: Frederick de Ruiter
  • Login: fderuiter
  • Kind: user
  • Location: Minnesota
  • Company: Bright Research

GitHub Events

Total
  • Create event: 182
  • Issues event: 1
  • Release event: 4
  • Watch event: 2
  • Delete event: 177
  • Issue comment event: 18
  • Push event: 375
  • Pull request review comment event: 13
  • Pull request review event: 29
  • Pull request event: 344
Last Year
  • Create event: 182
  • Issues event: 1
  • Release event: 4
  • Watch event: 2
  • Delete event: 177
  • Issue comment event: 18
  • Push event: 375
  • Pull request review comment event: 13
  • Pull request review event: 29
  • Pull request event: 344

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 201
  • Average time to close issues: 4 minutes
  • Average time to close pull requests: about 7 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.09
  • Merged pull requests: 127
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 201
  • Average time to close issues: 4 minutes
  • Average time to close pull requests: about 7 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.09
  • Merged pull requests: 127
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • fderuiter (2)
Pull Request Authors
  • fderuiter (201)
Top Labels
Issue Labels
codex (1) documentation (1)
Pull Request Labels
codex (154)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 109 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
pypi.org: imednet

Unofficial Python SDK for the iMednet clinical trials API

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 109 Last month
Rankings
Dependent packages count: 8.9%
Average: 29.5%
Dependent repos count: 50.1%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/ci.yml actions
  • abatilo/actions-poetry v2 composite
  • actions/cache v3 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/release.yml actions
  • abatilo/actions-poetry v2 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • pypa/gh-action-pypi-publish release/v1 composite
poetry.lock pypi
  • alabaster 0.7.16
  • annotated-types 0.7.0
  • anyio 4.9.0
  • babel 2.17.0
  • black 25.1.0
  • certifi 2025.1.31
  • cfgv 3.4.0
  • charset-normalizer 3.4.1
  • click 8.1.8
  • colorama 0.4.6
  • coverage 7.8.0
  • distlib 0.3.9
  • docutils 0.19
  • exceptiongroup 1.2.2
  • filelock 3.18.0
  • h11 0.14.0
  • httpcore 1.0.8
  • httpx 0.28.1
  • identify 2.6.10
  • idna 3.10
  • imagesize 1.4.1
  • iniconfig 2.1.0
  • isort 6.0.1
  • jinja2 3.1.6
  • markdown-it-py 3.0.0
  • markupsafe 3.0.2
  • mdurl 0.1.2
  • mypy 1.15.0
  • mypy-extensions 1.1.0
  • nodeenv 1.9.1
  • numpy 2.2.5
  • packaging 25.0
  • pandas 2.2.3
  • pathspec 0.12.1
  • platformdirs 4.3.7
  • pluggy 1.5.0
  • pre-commit 4.2.0
  • pydantic 2.11.3
  • pydantic-core 2.33.1
  • pygments 2.19.1
  • pytest 8.3.5
  • pytest-cov 6.1.1
  • python-dateutil 2.9.0.post0
  • python-dotenv 1.1.0
  • pytz 2025.2
  • pyyaml 6.0.2
  • requests 2.32.3
  • responses 0.25.7
  • rich 14.0.0
  • ruff 0.11.6
  • shellingham 1.5.4
  • six 1.17.0
  • sniffio 1.3.1
  • snowballstemmer 2.2.0
  • sphinx 6.2.1
  • sphinx-autodoc-typehints 1.23.0
  • sphinx-rtd-theme 3.0.2
  • sphinxcontrib-applehelp 2.0.0
  • sphinxcontrib-devhelp 2.0.0
  • sphinxcontrib-htmlhelp 2.1.0
  • sphinxcontrib-jquery 4.1
  • sphinxcontrib-jsmath 1.0.1
  • sphinxcontrib-qthelp 2.0.0
  • sphinxcontrib-serializinghtml 2.0.0
  • tenacity 9.1.2
  • tomli 2.2.1
  • typer 0.15.2
  • types-requests 2.32.0.20250328
  • typing-extensions 4.13.2
  • typing-inspection 0.4.0
  • tzdata 2025.2
  • urllib3 2.4.0
  • virtualenv 20.30.0
pyproject.toml pypi
  • black ^25.1.0 develop
  • isort ^6.0.1 develop
  • mypy ^1.15.0 develop
  • pandas >=2.2.3,<3.0.0 develop
  • pre-commit ^4.2.0 develop
  • pytest ^8.3.5 develop
  • pytest-cov ^6.1.1 develop
  • responses ^0.25.7 develop
  • ruff ^0.11.6 develop
  • sphinx ^6.2.0 develop
  • sphinx-autodoc-typehints * develop
  • sphinx-rtd-theme ^3.0.2 develop
  • types-requests ^2.32.0.20250328 develop
  • httpx ^0.28.1
  • pandas >=2.2.3,<3.0.0
  • pydantic ^2.11.3
  • python ^3.10
  • python-dotenv ^1.1.0
  • requests >=2.32.3,<3.0.0
  • tenacity ^9.1.2
  • typer ^0.15.2