Skip to main content

Python client for the onepot API

Project description

onepot-python

Python client for the onepot API.

Installation

uv add onepot
# or
pip install onepot

Usage

from onepot import Client

client = Client(api_key="your-api-key")

response = client.search(
    smiles_list=["Cc1c(C(=O)Nc2ccc(N3CC(C)OC(C)C3)nc2)cccc1-c1ccc(OC(F)(F)F)cc1", ...],
    max_results=10,
    include_chemistry_risk_score=True,
)

Ordering

order = client.order(
    smiles=["CCO", "c1ccccc1"],
    email="you@example.com",
    notes="Optional notes",
)
# {"order_id": "a1b2c3d4-...", "molecule_count": 2}

curl Examples

Search

curl -X POST https://api.onepot.ai/v1/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "smiles_list": ["c1ccc(-c2ccccc2)cc1"],
    "max_results": 10
  }'

Search with Chemistry Risk

curl -X POST https://api.onepot.ai/v1/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "smiles_list": ["c1ccc(-c2ccccc2)cc1"],
    "max_results": 10,
    "include_chemistry_risk_score": true
  }'

Order

curl -X POST https://api.onepot.ai/v1/order \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "smiles": ["CCO", "c1ccccc1"],
    "email": "you@example.com",
    "notes": "Optional notes"
  }'

Pricing

Credits are charged per SMILES in the query:

Option Credits per SMILES
Base search 1
include_chemistry_risk=True 5
include_chemistry_risk_score=True 10

Response Format

{
    "queries": [
        {
            "query_smiles": "Cc1c(C(=O)Nc2ccc(N3CC(C)OC(C)C3)nc2)cccc1-c1ccc(OC(F)(F)F)cc1",
            "query_inchikey": "VZZJRYRQSPEMTK-CALCHBBNSA-N",
            "results": [
                {
                    "chemistry_risk": "medium",     # if include_chemistry_risk=True
                    "chemistry_risk_score": 0.5,    # if include_chemistry_risk_score=True
                    "inchikey": "VZZJRYRQSPEMTK-UHFFFAOYSA-N",
                    "price_usd": 590,
                    "similarity": 1.0,
                    "smiles": "Cc1c(C(=O)Nc2ccc(N3CC(C)OC(C)C3)nc2)cccc1-c1ccc(OC(F)(F)F)cc1",
                    "supplier_risk": "high",
                },
                ...
            ]
        },
        ...
    ],
    "credits_used": 10,
    "credits_remaining": 990
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onepot-0.1.4.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onepot-0.1.4-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file onepot-0.1.4.tar.gz.

File metadata

  • Download URL: onepot-0.1.4.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for onepot-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1a95dad8faa90e0f830fef35e6b43f1573311ec64c8f17a03bf0d51abf849e6a
MD5 18036ec0d3671609dca3ccf2d3ae119f
BLAKE2b-256 10e71cf9b437035e0b18709f99fe6b47950a3a7d1badc8b8b01a9464b9590528

See more details on using hashes here.

File details

Details for the file onepot-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: onepot-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for onepot-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ccde3fa6a2abc73a13c4849562b9c5c3957624e7cc4144c1a147f1b15d90072e
MD5 7ac56e194874886fbf93c4d4fa36758b
BLAKE2b-256 01e413daf636c76bc5df8404500a887bde4be11e2951ff8d0360e7acb09fa43f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page