Skip to main content

SQLAlchemy ORM schema for ChEMBL.

Project description

chembl-sqlalchemy

SQLAlchemy ORM models for the ChEMBL database, enabling programmatic access to ChEMBL data using Python.

This package allows you to query and explore ChEMBL bioactivity data using SQLAlchemy, without having to manually define the table schemas yourself.


Installation

Install via pip:

pip install chembl-sqlalchemy

Usage

from chembl_sqlalchemy import Activities
from sqlalchemy import create_engine, select, sessionmaker

# Connect to a local ChEMBL SQLite database
engine = create_engine("sqlite:///chembl_35.db")
Session = sessionmaker(bind=engine)
session = Session()

# Example query: Get first 1000 non-null pChEMBL values
query = (
    select(Activities.molregno, Activities.pchembl_value, Activities.standard_type)
    .where(Activities.pchembl_value.isnot(None))
    .limit(1000)
)

results = session.execute(query).fetchall()

for molregno, pchembl_value, standard_type in results:
    print(molregno, pchembl_value, standard_type)

Versioning

The versioning scheme is:

MAJOR.MINOR.CHEMBL_VERSION

For example:

  • 1.0.35 → First release of the ORM wrapper
  • 1.1.35 → Minor enhancements to the ORM wrapper

Each package version explicitly corresponds to a specific ChEMBL database version to avoid compatibility issues.


Database Files

The package does not include the ChEMBL database file itself. You can download the corresponding SQLite file from the ChEMBL downloads page.

Place it in your project directory or reference it by path when creating the SQLAlchemy engine.


License

This project is licensed under the MIT License.

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

chembl_sqlalchemy-1.0.35.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

chembl_sqlalchemy-1.0.35-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file chembl_sqlalchemy-1.0.35.tar.gz.

File metadata

  • Download URL: chembl_sqlalchemy-1.0.35.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for chembl_sqlalchemy-1.0.35.tar.gz
Algorithm Hash digest
SHA256 0b2d6941ea66a86e4a668d8b0b961745e11a216667d6135515b719e620b61130
MD5 4903746dae61338eccfdd821e7f6b0f9
BLAKE2b-256 4f11987d0becb47f0aab7ddfee4968f925acfa8e15ac8e54eac767dac3e29ee9

See more details on using hashes here.

File details

Details for the file chembl_sqlalchemy-1.0.35-py3-none-any.whl.

File metadata

File hashes

Hashes for chembl_sqlalchemy-1.0.35-py3-none-any.whl
Algorithm Hash digest
SHA256 e46b748c2f2c5b35de49de7bade5e4274039233329f874ccd5e1dd6ddf24876e
MD5 3480afbad200d54930af46ebb563c66b
BLAKE2b-256 458601a78b8f8296dd80768545bbfd698d8157719166fc02878036d02237559e

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