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.5

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.5
File Actions
pybiotech-0.3.5-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pybiotech-0.3.5-cp313-cp313-win_amd64.whl
pybiotech-0.3.5-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.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pybiotech-0.3.5-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pybiotech-0.3.5-cp312-cp312-win_amd64.whl
pybiotech-0.3.5-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.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pybiotech-0.3.5-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pybiotech-0.3.5-cp311-cp311-win_amd64.whl
pybiotech-0.3.5-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.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Total release size: 40.8 MB

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

Download URL pybiotech-0.3.5-cp313-cp313-win_amd64.whl
Size 4.5 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
47d86393315d45a967d8fa29e9061ca80db32b8aade0d50105174328381d3df1
BLAKE2b-256 checksum
How to use checksums
f13384a9e6c399e7c1002a6d276438944b7a61eae78168247fd0ed664bf56625
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.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pybiotech-0.3.5-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
cc755ae808053bd925e4bd5111a5eeb682050fa51465e4e5e3d3db2a423df725
BLAKE2b-256 checksum
How to use checksums
24a8105994aa2b89cf5115a680935e5ec83bd4d14af95d82d491cadb227c6aba
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.5-cp312-cp312-win_amd64.whl

Download URL pybiotech-0.3.5-cp312-cp312-win_amd64.whl
Size 4.5 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
4974a014093cb81a3235ed32ad7f2299dd2de277f6c4bb190927b6d5600cb3bf
BLAKE2b-256 checksum
How to use checksums
1cd3118671370e636b3e235fc4b9e6ca65d6b8cf747e8434e18f9f8136191ddb
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.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pybiotech-0.3.5-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
94852c08a81de6997ebd458c841ed4d6d3afaf531afe23566c686e4c1afd5791
BLAKE2b-256 checksum
How to use checksums
3dc585b898bb55eade33295399aeb83269bbdaa2c84bfddd657fab3721c4987e
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.5-cp311-cp311-win_amd64.whl

Download URL pybiotech-0.3.5-cp311-cp311-win_amd64.whl
Size 4.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
954f6b78586f48469f53e8b488e55b61362921b6e3674610d1471b16c5415532
BLAKE2b-256 checksum
How to use checksums
57025862a3be5888d8d05f9cdef2d5d957c36d77f1cf40372ce2f51e38927fc2
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.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pybiotech-0.3.5-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
2b6847b36424b86870a94d7559b494c6281dc4ab9170a653cb675cca6d4bb864
BLAKE2b-256 checksum
How to use checksums
80660e589a3788f9679847dd4233b60b0e3d9ee9739d235dcddcad5505d4cb6a
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.5

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