{"id":34043052,"url":"https://github.com/fderuiter/imednet-python-sdk","last_synced_at":"2026-05-11T18:01:31.338Z","repository":{"id":298924605,"uuid":"968730806","full_name":"fderuiter/imednet-python-sdk","owner":"fderuiter","description":"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.","archived":false,"fork":false,"pushed_at":"2026-05-04T19:11:32.000Z","size":2076,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-04T19:14:05.614Z","etag":null,"topics":["api","automation","clinical","clinical-trials","data-integration","edc","healthcare","imednet","python","research","sdk"],"latest_commit_sha":null,"homepage":"https://fderuiter.github.io/imednet-python-sdk/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fderuiter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-04-18T16:16:19.000Z","updated_at":"2026-05-04T17:07:55.000Z","dependencies_parsed_at":"2026-02-11T03:16:00.609Z","dependency_job_id":null,"html_url":"https://github.com/fderuiter/imednet-python-sdk","commit_stats":null,"previous_names":["fderuiter/imednet-python-sdk"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/fderuiter/imednet-python-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fderuiter%2Fimednet-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fderuiter%2Fimednet-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fderuiter%2Fimednet-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fderuiter%2Fimednet-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fderuiter","download_url":"https://codeload.github.com/fderuiter/imednet-python-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fderuiter%2Fimednet-python-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32906515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-11T17:09:15.040Z","status":"ssl_error","status_checked_at":"2026-05-11T17:08:45.420Z","response_time":120,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","automation","clinical","clinical-trials","data-integration","edc","healthcare","imednet","python","research","sdk"],"created_at":"2025-12-13T22:57:35.864Z","updated_at":"2026-05-11T18:01:31.299Z","avatar_url":"https://github.com/fderuiter.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imednet\n\n**Unofficial Python SDK for the iMednet clinical trials API.**\n\nFull documentation: \u003chttps://fderuiter.github.io/imednet-python-sdk/\u003e\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![PyPI](https://img.shields.io/pypi/v/imednet.svg)](https://pypi.org/project/imednet/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/imednet.svg)](https://pypi.org/project/imednet/)\n[![PyPI - Wheel](https://img.shields.io/pypi/wheel/imednet.svg)](https://pypi.org/project/imednet/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/imednet.svg)](https://pypi.org/project/imednet/)\n[![License](https://img.shields.io/pypi/l/imednet.svg)](LICENSE)\n[![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)\n[![Coverage](https://img.shields.io/badge/coverage-90%25-brightgreen)](https://github.com/fderuiter/imednet-python-sdk)\n\n\u003c/div\u003e\n\nThis package simplifies integration with the iMednet REST API for clinical trial\nmanagement. It provides typed endpoint wrappers, helper workflows and a CLI so\nresearchers and developers can automate data extraction and submission without\nreimplementing HTTP logic.\n\n## Features\n\n- Simple, consistent interface for API calls\n- Automatic pagination across endpoints\n- Pydantic models for requests and responses\n- Workflow helpers for data extraction and mapping\n- Pandas and CSV utilities\n- Optional in-memory caching of study metadata\n- Structured JSON logging and OpenTelemetry tracing\n- Async client and command line interface\n- **Form Designer**: Pythonic API for building and validating CRFs\n\n---\n\n## Architecture\n\nThe SDK is organized around a core HTTP client layer, endpoint wrappers that model\nthe iMednet API, workflow helpers that combine multiple endpoint calls, and a CLI\nbuilt on top of those pieces.\n\n```mermaid\ngraph TD\n    CLI[CLI] --\u003e |invokes| Workflows\n    Workflows --\u003e |coordinate| Endpoints\n    Endpoints --\u003e |use| Client[\"(HTTP Client)\"]\n    Client --\u003e |httpx| API\n```\n\n---\n\n## Installation\n\n```bash\n# PyPI release\npip install imednet\n```\n\n### Optional Dependencies\n\nTo use export features, workflow plugins, or Airflow provider integrations, install the relevant extras/packages:\n\n```bash\n# Install all export dependencies\npip install \"imednet[pandas,sqlalchemy,pyarrow,excel]\"\n\n# Or pick specific ones\npip install \"imednet[sqlalchemy]\"  # For SQL export\npip install \"imednet[pyarrow]\"     # For Parquet export\npip install \"imednet[excel]\"       # For Excel export\n\n# Workflow plugin package\npip install imednet-workflows\n\n# Airflow provider package\npip install apache-airflow-providers-imednet apache-airflow-providers-amazon\n```\n\n### Development Version\n\n```bash\npip install git+https://github.com/fderuiter/imednet-python-sdk.git@main\n```\n\n---\n\n## Quick Start\n\nSet your credentials by copying the environment template or exporting them directly:\n\n```bash\n# Option 1: Use a .env file (recommended)\ncp .env.example .env\n\n# Option 2: Export directly to your shell\nexport IMEDNET_API_KEY=\"your_api_key\"\nexport IMEDNET_SECURITY_KEY=\"your_security_key\"\n# Optional: Custom base URL for the API endpoint\n# export IMEDNET_BASE_URL=\"https://example.com\"\n```\n\n### Synchronous Example\n\n```python\nfrom dotenv import load_dotenv\n\nfrom imednet import ImednetSDK, load_config\nfrom imednet.utils import configure_json_logging\n\n# Optional: Configure structured JSON logging\nconfigure_json_logging()\n\n# Load credentials from .env file or environment variables\nload_dotenv()\ncfg = load_config()\n\nwith ImednetSDK(\n    api_key=cfg.api_key,\n    security_key=cfg.security_key,\n    base_url=cfg.base_url,\n) as sdk:\n    # List all studies available to the user\n    studies = sdk.studies.list()\n    for study in studies:\n        print(f\"{study.study_name} ({study.study_key})\")\n```\n\n### Asynchronous Example\n\n```python\nimport asyncio\n\nfrom dotenv import load_dotenv\n\nfrom imednet import AsyncImednetSDK, load_config\nfrom imednet.utils import configure_json_logging\n\nasync def main() -\u003e None:\n    # Optional: Configure structured JSON logging\n    configure_json_logging()\n\n    # Load credentials from .env file or environment variables\n    load_dotenv()\n    cfg = load_config()\n\n    async with AsyncImednetSDK(\n        api_key=cfg.api_key,\n        security_key=cfg.security_key,\n        base_url=cfg.base_url,\n    ) as sdk:\n        studies = await sdk.studies.async_list()\n        for study in studies:\n            print(f\"{study.study_name} ({study.study_key})\")\n\nasyncio.run(main())\n```\n\nSee [docs/async_quick_start.rst](docs/async_quick_start.rst) for more details.\n\n---\n\n## Configuration\n\nThe SDK and CLI read credentials from environment variables such as\n`IMEDNET_API_KEY` and `IMEDNET_SECURITY_KEY`. You can set these in your shell or\nuse a `.env` file. Copy `.env.example` to `.env` to get started.\n\nSee [configuration](docs/configuration.rst) for the complete list of options.\nUse `imednet.config.load_config()` to access these values in your code.\n\n---\n\n## CLI Usage\n\nThe package installs an `imednet` command with subcommands for studies, sites,\nsubjects, records, jobs, queries and more. Use `imednet --help` to explore all\noptions.\n\n*(Note: If you are running the project from source or a local clone, make sure to first install dependencies with `poetry install`. Then, prefix commands with `poetry run`, e.g., `poetry run imednet --help`)*\n\n### Data Export\n\nExample of exporting a subset of variables:\n\n```bash\nimednet export sql MY_STUDY table sqlite:///data.db --vars AGE,SEX --forms 10,20\n```\n\nWhen the connection string uses SQLite, the command splits the output into one\ntable per form to avoid the 2000 column limit (in this case, the `table`\nargument is ignored). Pass ``--single-table`` to disable this behaviour and use\nthe specified table name. See ``docs/cli.rst`` for full examples.\n\n---\n\n## Documentation \u0026 Resources\n\n- **API Documentation**: Full documentation is available at\n  \u003chttps://fderuiter.github.io/imednet-python-sdk/\u003e.\n- **Official iMednet API Docs**: \u003chttps://portal.prod.imednetapi.com/\u003e.\n- **Postman Collection**: Download\n  [`imednet.postman_collection.json`](imednet.postman_collection.json) and import it\n  into Postman to explore and test the API endpoints.\n\n---\n\n## Development \u0026 Contributing\n\n### Tech Stack\n\n- Python 3.10–3.12\n- httpx, pydantic, typer, tenacity, python-dotenv\n\n### Prerequisites\n\n- [Poetry](https://python-poetry.org/docs/) (for dependency management)\n- [Make](https://www.gnu.org/software/make/) (optional, for building docs)\n\n### Project Structure\n\n```\n.\n├── docs/       - Sphinx documentation\n├── examples/   - Usage samples\n├── imednet/    - SDK package\n├── scripts/    - Helper scripts\n└── tests/      - Unit and integration tests\n```\n\n### Testing \u0026 Development\n\n```bash\n./scripts/setup.sh  # once\npoetry run ruff check --fix .\npoetry run black --check .\npoetry run isort --check --profile black .\npoetry run mypy src/imednet\npoetry run pytest -q\n```\n\nAfter running tests, validate documentation builds cleanly (no warnings):\n\n```bash\nmake docs\n```\n\nSee [AGENTS.md](AGENTS.md) for full documentation guidelines.\n\n### Smoke-test workflow\n\nThe optional [smoke.yml](.github/workflows/smoke.yml) action runs the `tests/live` suite.\nIt relies on repository secrets `APIKEY` and `SECURITYKEY` and sets `IMEDNET_RUN_E2E`.\nUse the workflow to confirm real API access on demand or via its nightly schedule.\nINFO-level log messages stream to the terminal during these runs, making it easier to\ndebug failures.\n\n### Building \u0026 Publishing\n\n```bash\npython -m build\npython -m twine upload dist/*\n```\n\nPushing a Git tag like `v0.1.4` triggers the GitHub Actions workflow that builds\nand publishes the package to PyPI.\n\n### Versioning \u0026 Changelog\n\nThis project follows [Semantic Versioning](https://semver.org). See\n[GitHub Releases](https://github.com/fderuiter/imednet-python-sdk/releases) for release history.\n\n### Contributing\n\nContributions are welcome! See the\n[contributing guide](docs/contributing.rst) and\n[CONTRIBUTING.md](CONTRIBUTING.md) for full details.\n\n---\n\n## Troubleshooting\n\n**Missing or invalid required environment variable(s)**\nIf you see an error like `Error: IMEDNET_API_KEY and IMEDNET_SECURITY_KEY environment variables must be set.` (CLI) or `API key and security key are required` (SDK), or an \"Unauthorized\" or \"Forbidden\" (403) API error, ensure you have set valid keys in your shell or in a `.env` file in the directory where you run the script (avoid using \"dummy\" keys). See [Configuration](#configuration).\n\n**ModuleNotFoundError when running the CLI locally**\nIf you are running the `imednet` CLI from source (e.g., `poetry run imednet`) and see a `ModuleNotFoundError` (such as `No module named 'imednet'`), ensure you have installed the project dependencies by running `poetry install` in the project root.\n\n---\n\n## License\n\nThis project is licensed under the MIT license. See [LICENSE](LICENSE) for\ndetails.\n\n---\n\n## Acknowledgements\n\nBuilt with open source libraries including httpx, pydantic and typer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffderuiter%2Fimednet-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffderuiter%2Fimednet-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffderuiter%2Fimednet-python-sdk/lists"}