Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

fairfetched

data APIs for reproducible data fetching in cheminformatics in line with FAIR principles. the tool is designed such that all raw data is downloaded and kept in one central place (i.e. CHEMBL 37 as the original .db files), and the user has a fast, lightweight, intuitive API to filter / query the data as required for any particular project.

installation

you can install this package through uv add fairfetched (recommended)

or if you do not use the uv package manager: pip install fairfetched

examples

you can download Chembl or Papyrus through:

from fairfetched.get import Chembl, Papyrus

# Download the latest ChEMBL release (saves to ~/.data/chembl/<version>)
db = Chembl.from_latest()

# Raw source tables: db.tables.molecule_dictionary or db.lfs["molecule_dictionary"] (both LazyFrames)
# Joined domain views: db.view.bioactivity, db.view.compounds, db.view.proteins, db.view.components
# Parquet file paths: db.parquet_paths
# Raw download paths: db.raw_paths

examples of how to use the LazyFrames:

checking columns and datatypes:

from fairfetched.get import Chembl

db = Chembl.demo()
len(db.lfs["activities"].collect_schema())           # 29
db.lfs["activities"].collect_schema().names()[:4]    # ['molregno', 'activity_id', 'assay_id', 'doc_id']

accessing tables and joined views:

db.tables.molecule_dictionary.filter(molregno=1280).collect()["pref_name"].to_list()  # ['ASPIRIN']
db.view.compounds.collect().shape                                                     # (5, 50)

selecting and joining tables:

# select specific columns
db.lfs["activities"].filter(molregno=1280).select(
    "activity_id", "assay_id", "standard_value"
).head(3).collect()
# shape: (3, 3)
# ┌─────────────┬──────────┬────────────────┐
# │ activity_id ┆ assay_id ┆ standard_value │
# ├─────────────┼──────────┼────────────────┤
# │ ...         ┆ ...      ┆ ...            │
# └─────────────┴──────────┴────────────────┘

# join with compound structures
result = db.lfs["activities"].join(
    db.lfs["compound_structures"], on="molregno", how="left", validate="m:1"
).head().collect()
# result.shape → (5, 32)

convert to pandas (if needed):

Ideally at the end of all filtering, call .collect().to_pandas() (see polars documentation for more info):

import pandas as pd

df = db.lfs["activities"].head().collect().to_pandas()
isinstance(df, pd.DataFrame)  # True

roadmap

  • papyrus database support
    • papyrus latest version download
    • simple nested filtering
    • efficient nested filtering
    • all-version support
    • built-in pivots
  • chembl database support
    • database to tables (parquet)
    • intuitive pre-merged flat files
    • database visualisation
    • remove the need for storing uncompressed .db (_tables.json lists the finished tables)
  • reproducion from downloaded raw file
  • reproducible molecular (and protein?) standardisation
  • automated time-url logging and manifest files
  • well-organised logging
  • dependency minimisation
  • other database support
  • preservation of api and parsing logic per major version

Metadata

Release files for fairfetched 0.1.0a20261015

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

Source distribution (sdist)

Source distribution for fairfetched 0.1.0a20261015
File Size Uploaded Provenance Actions
fairfetched-0.1.0a20261015.tar.gz 246.1 kB Without provenance Details for fairfetched-0.1.0a20261015.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fairfetched 0.1.0a20261015
File Interpreter ABI Platform Actions
fairfetched-0.1.0a20261015-py3-none-any.whl Python 3 none any Details for fairfetched-0.1.0a20261015-py3-none-any.whl

Total release size: 464.6 kB

Release files / fairfetched-0.1.0a20261015.tar.gz

Download URL fairfetched-0.1.0a20261015.tar.gz
Size 246.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fd143640c32a5528d2aed8579728c915d433d4f10975d51c716e8a1b46b9b90c
BLAKE2b-256 checksum
How to use checksums
317637bd3a95b80763180f5055dfabbb192fb27010574cf324ee071279d2d4da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fairfetched-0.1.0a20261015-py3-none-any.whl

Download URL fairfetched-0.1.0a20261015-py3-none-any.whl
Size 218.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
319ba1efeda958266a62bd660e6c8494abaa41d9e781263577bc9f84ecfa228b
BLAKE2b-256 checksum
How to use checksums
cf2451592eaa6df239422209c00f5be035a41989c71b1de5945fb5ea64575461
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fairfetched 0.1.0a20261015

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