Skip to main content

A collection of reusable python biotech library from AI Lingues.

Project description

AI Lingues Biotech Python Library

Python Version License Status

pybiotech is a biology-focused toolkit from AI Lingues 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.
  • 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.10 or newer (3.11 recommended)
  • RDKit for molecule processing
  • Additional dependencies declared in pyproject.toml / requirements.txt (xsdata, lxml, pydantic, scipy, numpy, etc.)

📚 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())

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

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
  • 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/
      • 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.ailingues.com

Email: support@ailingues.com

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


Made with ❤️ by AI Lingues Team

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pybiotech-0.2.8-cp311-cp311-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.11Windows x86-64

pybiotech-0.2.8-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file pybiotech-0.2.8-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pybiotech-0.2.8-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pybiotech-0.2.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f81b7d63e6195386d64498c6fb5f92e4feb222e7e3e62f27208c3818c66e7c81
MD5 a684f2116b3e53128678b151e68ac583
BLAKE2b-256 9e4f8226946364bfe27be0eebcc58f8059b6d013aac64cc73e92d85225067fee

See more details on using hashes here.

File details

Details for the file pybiotech-0.2.8-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybiotech-0.2.8-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b10079196d6a4d72669592f0b3464c9d5f2b5217ca0ff1d64b899f25fb29a1c7
MD5 a454f016d92c7168ab79fd685bbba1a0
BLAKE2b-256 0bef40fc2a517c9b87770e96bd3a52ceb325fe4092941bee8c23def9a91fae36

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