Skip to main content

AccelBio.AI Biotech Python Library

Python Version License Status

pybiotech is a biology-focused toolkit from AccelBio.AI that builds on RDKit, PubChem, and UniProt to deliver molecule optimization, fingerprinting, structured loaders, and request modeling for data-driven biomedical workflows.


Key Capabilities

  • Molecular engineering with ETKDG embedding, MMFF/UFF optimization, surface and hydrophobic metrics, ring counts, fingerprints, and pharmacophore distances.
  • Binary serialization that wraps rdkit.Chem.Mol objects in a CRC32-protected container suitable for IPC, sockets, or shared memory.
  • Loader stack covering file, directory, and text SDF parsing plus UniProt XML streaming with error tolerance and namespace handling.
  • Local PubChem SDF indexing with LMDB-backed CID, Conformer ID, and ALID lookup without duplicating the original records.
  • PubChem request builder that unifies Input, Operation, Output, and Query segments, enforces validation rules, and can reverse-parse existing URLs.
  • Schema modeling using Pydantic and xsdata so UniProt query fields and PubChem domain pieces stay type-safe.

📦 Installation

Install from PyPI

pip install pybiotech

Requirements

  • Python 3.11 or newer
  • RDKit for molecule processing
  • Additional dependencies declared in pyproject.toml / requirements.txt (xsdata, lxml, pydantic, scipy, numpy, etc.)
  • lmdb==3.0.0 is declared in pyproject.toml for the local PubChem SDF index.

📚 Quick Start

1. Embed, optimize, and serialize a molecule

from rdkit import Chem
from pybiotech.core.molecule.optimizer import Optimizer

mol = Chem.MolFromSmiles("c1ccccc1O")
mol3d, ok, meta = Optimizer.embed_and_optimize(mol, random_seed=42)
blob = Optimizer.to_serialize([mol3d, None], include_props=True, with_checksum=True)
print("converged:", ok, "method:", meta["method"])

2. Read SDF records from a directory

from pybiotech.loaders.sdf_loader import SDFLoader

mols, expected, actual = SDFLoader.readDataFromDir("data/sdf", recursive=True)
print(f"expected {expected}, loaded {actual} valid molecules")

3. Build a PubChem REST URL

from pybiotech.classes.nih.https.pubchem.input_spec import InputSpec
from pybiotech.classes.nih.https.pubchem.opera_spec import OperationSpec
from pybiotech.classes.nih.https.pubchem.output_spec import OutputSpec
from pybiotech.classes.nih.https.pubchem.query_options import QueryOptions
from pybiotech.classes.nih.https.pubchem.request import PubChemRequest

input_spec = InputSpec(domain="compound", namespace="cid", identifiers="2244")
operation_spec = OperationSpec(operation="property", tags=["MolecularFormula", "InChIKey"], domain="compound")
output_spec = OutputSpec(output_format="JSON")
query_options = QueryOptions(record_type="3d", image_size="large")

req = PubChemRequest(
    input_spec=input_spec,
    operation_spec=operation_spec,
    output_spec=output_spec,
    query_options=query_options,
)
print(req.build_url())

4. Build and query a local PubChem SDF index

The local index stores file paths and byte offsets rather than copying SDF records into the database. Keep the original SDF files after building the index. Builds resume from committed record checkpoints if interrupted. Within one LMDB index, byte-identical records with the same Compound CID or Conformer ID are indexed once. By default, a conflicting record stops the build; ignore_errors=True reports and skips recoverable record errors.

from pybiotech.loaders.nih.pubchem.local import SDFIndex, SDFIndexBuilder

source_dir = r"D:\data\pubchem\source\compound"
index_dir = r"D:\data\pubchem\index\compound"

meta = SDFIndexBuilder(
    source_dir, index_dir, kind="compound", ignore_errors=False, verbose=False
).build()
print(meta["total_records"], meta["total_skipped_duplicate_records"])

with SDFIndex(index_dir, readonly=True) as index:
    hit = index.get_compound_by_cid(2244)
    if hit is not None:
        sdf_text = index.read_segment(source_dir, hit.locator).decode(
            "utf-8", errors="replace"
        )
        print(sdf_text)

The package also provides a command line entrypoint. For large indexes, use build-sharded to split a single large SDF at complete record boundaries into independent LMDB shards. Run these PowerShell commands with PyBioTech installed:

python -m pybiotech.loaders.nih.pubchem.local build-sharded `
  --root D:\data\pubchem\source\compound `
  --index D:\data\pubchem\index\compound-sharded `
  --kind compound `
  --no-ignore-errors `
  --target-source-bytes 68719476736

Use --ignore-errors on build or build-sharded to log and skip recoverable record errors. See the local PubChem SDF index guide for the precise policy, counters, single-index and sharded queries, and source validation.


Module overview

Core (molecule)

Module Purpose Docs
core.molecule.calculator Geometry, surface, fingerprint, and pharmacophore helpers for Chem.Mol. docs/core/molecule/calculator.md
core.molecule.optimizer ETKDG embedding plus MMFF/UFF optimization, serialization container, and checksum-aware deserialization. docs/core/molecule/optimizer.md

Loaders

Module Purpose Docs
loaders.sdf_loader Stream file/dir/text SDF content with index filtering, error tolerance, and warning control. docs/pybiotech/loaders/sdf_loader.md
loaders.uniprot_loader Auto namespace detection and entry-by-entry UniProt XML parsing. docs/pybiotech/loaders/uniprot_loader.md
loaders.uniprot_query_field_loader Load QueryField definitions from JSON/text and build validated term:value fragments. docs/pybiotech/loaders/uniprot_query_field_loader.md
loaders.nih.pubchem.local Build and query LMDB byte-offset indexes for local PubChem Compound and Conformer SDF data. README

Classes (models and request helpers)

Module Purpose Docs
classes.uniprot.https.uniprot.org.uniprot_query_field Pydantic QueryField model with recursive siblings/items. docs/classes/uniprot/https/uniprot/org/uniprot_query_field.md
classes.uniprot.https.uniprot.org.uniprot xsdata-generated dataclasses and enums for UniProt Entry, Protein, Sequence, etc. docs/classes/uniprot/https/uniprot/org/uniprot.md
classes.nih.https.pubchem.* Input, Operation, Output, Query, Request, and Identifier/domain modeling for PubChem PUG REST. docs/classes/nih/https/pubchem

📖 Documentation

Detailed API references are under docs/:

  • docs/core/molecule/ - optimizer and calculator references
  • docs/pybiotech/loaders/ - SDF/UniProt loader documentation
  • pybiotech/loaders/nih/pubchem/local/README.md - local PubChem SDF indexing, CLI, and Python API guide
  • docs/classes/nih/https/pubchem/ - PubChem URL and query modeling
  • docs/classes/uniprot/https/uniprot/org/ - UniProt schema reference

🏗️ Project layout

  • pybiotech/
    • pybiotech/
      • core/
        • molecule/
      • loaders/
        • nih/pubchem/local/
      • classes/
    • docs/
    • scripts/
    • README.md
    • README_Example.md
    • pyproject.toml
    • requirements.txt

📝 License & Usage Terms

Package Usage License

The PyBiotech package (the binary package installed via pip) is released under the MIT License:

  • ✅ Free Use – May be used freely in personal and enterprise projects
  • ✅ Commercial Use – Allowed in commercial products and services
  • ✅ Free Distribution – You may freely distribute and redistribute the package
  • ✅ No Usage Restrictions – No fees or additional authorization required

Source Code Protection Terms

Important Notice: The source code of this project is private property and protected by intellectual property law:

  • ❌ Source Code Not Public – The source code is not publicly available
  • ❌ No Reverse Engineering – Decompilation, reverse engineering, or disassembly of the package is strictly prohibited
  • ❌ No Source Distribution – You may not obtain, copy, or distribute the source code in any form
  • ❌ No Modified Redistribution – You may not modify the package and redistribute it In short: You are free to use our package (including for commercial purposes), but please respect our source code intellectual property rights.

📧 Contact Us

Website: https://www.accelbio.ai

Email: support@accelbio.ai

Technical Support: For any questions or suggestions, please contact us via email.


Made with ❤️ by AccelBio.AI Team

Metadata

Release files for pybiotech 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pybiotech 0.3.4
File Actions
pybiotech-0.3.4-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pybiotech-0.3.4-cp313-cp313-win_amd64.whl
pybiotech-0.3.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pybiotech-0.3.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pybiotech-0.3.4-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pybiotech-0.3.4-cp312-cp312-win_amd64.whl
pybiotech-0.3.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pybiotech-0.3.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pybiotech-0.3.4-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pybiotech-0.3.4-cp311-cp311-win_amd64.whl
pybiotech-0.3.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pybiotech-0.3.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Total release size: 40.7 MB

Release files / pybiotech-0.3.4-cp313-cp313-win_amd64.whl

Download URL pybiotech-0.3.4-cp313-cp313-win_amd64.whl
Size 4.5 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
8825aaa72574d10ae4fe1c52ca742f6c329a7c5d845332d1a99e9793c595bef3
BLAKE2b-256 checksum
How to use checksums
2a78d219be1614a2c37f8acd9eec93edf480f92b58b6aa43dedfc65d25351878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pybiotech-0.3.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pybiotech-0.3.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 9.5 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c39053b59adeeb1afe17f58efa7f88690bf2bf94d5164b38cd89a6aad99c2226
BLAKE2b-256 checksum
How to use checksums
9d4a05884d7676aef1136cf4cb57fdf7947936bd8c9ac30865f5acba43c30c8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pybiotech-0.3.4-cp312-cp312-win_amd64.whl

Download URL pybiotech-0.3.4-cp312-cp312-win_amd64.whl
Size 4.5 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
7f0fe05bcaf2989b0e43fae9f3c8631eb57dd767db255359acb63bb83182c72b
BLAKE2b-256 checksum
How to use checksums
74c65c83ea42f97ed241961212bb79903917df83f1efc4d9f341c3c2f6a0122f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pybiotech-0.3.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pybiotech-0.3.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 9.4 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
408fdda2eae7bcd232c9aa388b911b5bf792857754c301c1bce5386339dbe9fd
BLAKE2b-256 checksum
How to use checksums
9c1ed648c15c872e5629f60f623a119c3bd3593c4cadf05a143ae1fb276461c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pybiotech-0.3.4-cp311-cp311-win_amd64.whl

Download URL pybiotech-0.3.4-cp311-cp311-win_amd64.whl
Size 4.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
85948a4d7d2ec3c7c5cee0b1e84cb6e86117d74ae38ed8bf0ef66ce627b481de
BLAKE2b-256 checksum
How to use checksums
f4f8c4c0ddafe690ca48120a439d587e0d8baecb2c6a2e69349612793f36381b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pybiotech-0.3.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pybiotech-0.3.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 8.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d5feeb3243c48dc9d584bb58eae8fbb2c42e516fa39afb4a353fc18bccfd4536
BLAKE2b-256 checksum
How to use checksums
1d99c33793ae0b7f0943adc1c8fb7bcb920818ecae0babbc45689391efd5c5fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for pybiotech 0.3.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page