AccelBio.AI Biotech Python Library
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.)
lmdbfor the local PubChem SDF index. Until it is added topyproject.toml, install it separately withpython -m pip install lmdb.
📚 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.
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"
builder = SDFIndexBuilder(source_dir, index_dir)
try:
print(builder.build())
finally:
builder.idx.env.close()
index = SDFIndex(index_dir, readonly=True)
try:
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)
finally:
index.env.close()
When working from a source checkout, a development CLI is also available. Run these PowerShell commands from the repository root:
$env:PYTHONPATH = (Resolve-Path "test\loaders\nih\pubchem\local").Path
python -m data.main build `
--root D:\data\pubchem\source\compound `
--index D:\data\pubchem\index\compound
This development CLI is not installed as a standalone console command in the PyBioTech wheel. See the local PubChem SDF index guide for Compound/Conformer queries, batch APIs, data layout, and limitations.
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/
- core/
- docs/
- scripts/
- README.md
- README_Example.md
- pyproject.toml
- requirements.txt
- pybiotech/
📝 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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 38.1 MB
Release files / pybiotech-0.3.3-cp313-cp313-win_amd64.whl
| Download URL | pybiotech-0.3.3-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
37502ca1135e53dd496f27216a2d489cb0215768dbd56032e39b406a43f85f2a
|
|
BLAKE2b-256 checksum How to use checksums |
d9dad1129f2d042ff0367989a24c5c5955dcb87594487ac96be89035af4d44f7
|
| 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.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pybiotech-0.3.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.0 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
efee1f72c94aa4e19414ac4f8913cb554e1dc5b4333310ff314a38b072ea3aae
|
|
BLAKE2b-256 checksum How to use checksums |
7e3e2a85e9db707e9503b93551751bfceaf354082fabaf10926cb8d9c4e32977
|
| 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.3-cp312-cp312-win_amd64.whl
| Download URL | pybiotech-0.3.3-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
90e49e59360328f94fa8db34cd93b91d0eb6fae2bccbaea41593f945a8246da2
|
|
BLAKE2b-256 checksum How to use checksums |
e213e741b4f1b025ff3d62026c602bb7587b6b834158a99628bcb85ebeca7bf2
|
| 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.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pybiotech-0.3.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 8.9 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
74c7cd91c62eb7e9756efe1fadf5519b73ea507419cb2506e31b345ef1b7e520
|
|
BLAKE2b-256 checksum How to use checksums |
62f235e692025cdc8fc522b9135d2b8fc83eb691b15ef4f3dbe0c379ca274af6
|
| 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.3-cp311-cp311-win_amd64.whl
| Download URL | pybiotech-0.3.3-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
91790b9b3f3358cf880960a475a929070667e8012a258d56d02d756a4dec4d56
|
|
BLAKE2b-256 checksum How to use checksums |
78b257e3e6291a94cfbd95a53190ebac6b49365c1eae7fb37bc273a62485bba3
|
| 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.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pybiotech-0.3.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 8.1 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
17091f67f45ca421cc15feecebdbc378779898296d94c14d7b36d88d067c3b8f
|
|
BLAKE2b-256 checksum How to use checksums |
3f41ecc38f9e24f763fa67bb48047cefc7b02ac35ad3d7da4e76c40fc6f83958
|
| 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.3
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.