Python SDK for the OM Gateway V2
Project description
OMTX Python SDK
Simple Python client for the OM API Gateway. Generate molecular diligence reports and perform deep scientific research with just a few lines of code.
Installation
pip install omtx
Quick Start
from omtx import Client
# Initialize client (uses OMTX_API_KEY environment variable)
client = Client()
# Generate a diligence report
result = client.generate_diligence("BRAF")
print(result.summary)
# Perform deep research
research = client.deep_research("CRISPR applications in cancer treatment")
print(research.final_report)
# Check available credits
credits = client.credits()
print(f"Available credits: {credits}")
Setup
Get an API Key
- Sign up at https://omtx.ai
- Navigate to your dashboard
- Generate an API key
Set Your API Key
Option 1: Environment Variable (Recommended)
export OMTX_API_KEY="your-api-key-here"
Option 2: Pass to Client
from omtx import Client
client = Client(api_key="your-api-key-here")
Examples
Generate Diligence Report
from omtx import Client
client = Client()
# Generate report for a molecular target
result = client.generate_diligence("KRAS")
# Access the summary
print(result.summary)
# Access full report data
print(result.report_data)
Deep Research
from omtx import Client
client = Client()
# Perform deep research on a scientific query
research = client.deep_research(
"CAR-T therapy mechanisms and recent advances",
max_iterations=5 # Optional: more iterations = deeper research
)
# View the final report
print(research.final_report)
# Access individual findings
for finding in research.findings:
print(f"- {finding['claim']}")
# Check execution time
print(f"Research completed in {research.execution_time:.1f} seconds")
Error Handling
from omtx import Client, OMTXError, InsufficientCreditsError
client = Client()
try:
result = client.generate_diligence("BRAF")
except InsufficientCreditsError as e:
print(f"Not enough credits. Please add more credits to your account.")
except OMTXError as e:
print(f"An error occurred: {e}")
Context Manager
from omtx import Client
# Automatically cleans up resources
with Client() as client:
result = client.generate_diligence("TP53")
print(result.summary)
Available Methods
generate_diligence(target)- Generate a comprehensive diligence report for a molecular targetdeep_research(query, max_iterations=3)- Perform iterative deep research on a scientific querycredits()- Check available credits
Features
- Simple API - Just a few methods to remember
- Automatic Retries - Handles transient network errors automatically
- Idempotency - Safe to retry requests without double charges
- Type Hints - Full IDE autocomplete support
- Error Handling - Clear, actionable error messages
Requirements
- Python 3.8 or higher
- An OMTX API key
Support
- Email: support@omtx.ai
- Documentation: https://docs.omtx.ai
- Issues: https://github.com/omtx/python-sdk/issues
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
omtx-0.1.0.tar.gz
(11.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
omtx-0.1.0-py3-none-any.whl
(11.2 kB
view details)
File details
Details for the file omtx-0.1.0.tar.gz.
File metadata
- Download URL: omtx-0.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4f01114419b1b4e9173735d2933c864a4ba685a8a654fd2eae184162c63d58d
|
|
| MD5 |
341e304544fbacb1bafbc8f83171f083
|
|
| BLAKE2b-256 |
4db3e833a98b37f6e87a4245094214bf8f464e7c76afb1a96ada91170d95b132
|
File details
Details for the file omtx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: omtx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
587ff1110fac9b705992265742ffb79b5c78738b9d7fcfe4b19e98faaad02214
|
|
| MD5 |
af9646be50edeabf2dd66489313655bb
|
|
| BLAKE2b-256 |
5d1b4c1db0e55a98747d7c337eef97e9a1b8a3f967dd1fefe7af74ffd53ce073
|