Skip to main content

Python package interface for RCSB.org API services

Project description

PyPi Release Build Status Documentation Status DOI OpenSSF Best Practices FAIR checklist badge fair-software.eu


rcsb-api: Python Toolkit for Accessing RCSB.org APIs

Python interface for RCSB Protein Data Bank API services at RCSB.org.

Installation

This package requires Python 3.9 or later.

Install it from PyPI via pip or uv:

pip install rcsb-api

# or, if using uv:
uv pip install rcsb-api

Or, download from GitHub and install locally:

git clone https://github.com/rcsb/py-rcsb-api.git
cd py-rcsb-api
pip install .

Overview

The rcsb-api package provides a simple Pythonic interface to the suite of RCSB PDB APIs for querying and fetching data in the PDB. Specifically, each API service is provided as a separate "module" (or sub-package) within the Python client, and offers the following set of key functionalities:

  • Search API module (rcsbapi.search):

    • Perform all search types available through the RCSB.org Advanced Search builder (e.g., full-text, attribute-based, sequence and structure similarity, sequence and structure motif)
    • Use simple Boolean logic to intuitively construct complex or nested queries
    • Upload custom structure files for structure similarity searches
    • Include computed structure models (CSMs) in search results
  • Data API module (rcsbapi.data):

    • Retrieve any subset of metadata, features, and/or annotations for a given list of PDB IDs (e.g., experimental method details, structural annotations, binding sites, etc.)
    • Easily fetch data for all structures across the archive
    • Simplified GraphQL query construction using a Python syntax
  • Sequence Coordinate API module (rcsbapi.sequence):

    • Query alignments between structural and sequence databases as well as protein positional annotations/features integrated from multiple resources
    • Alignment data is available for NCBI RefSeq (including protein and genomic sequences), UniProt and PDB sequences
    • Protein positional features are integrated from UniProt, CATH, SCOPe and RCSB PDB and collected from the RCSB PDB Data Warehouse
  • Model API module (rcsbapi.model):

    • Provides access to molecular structure data (e.g., atomic coordinates) and related information (in mmCIF or BCIF formats)
    • Query for various structural data types, such as full structure, ligands, atoms, residue interactions, and more
    • Valuable for extracting out specific slices of a structure data file (not for bulk downloads, in which case see our download services)

Full package documentation is available at readthedocs.

Training Materials

  • Example usage for each module is available at readthedocs.
  • Several Jupyter notebooks with example use cases and workflows for all supported API services are provided under notebooks, which can be opened in Google Colab via the "Open in Colab" badge at the top of each notebook.
  • Watch our webinar, Streamlining Access to RCSB PDB APIs with Python, which provides an introduction to our Search and Data APIs along with hands-on tutorials.

Citing

Please cite the rcsb-api package with the following reference:

Dennis W. Piehl, Brinda Vallat, Ivana Truong, Habiba Morsy, Rusham Bhatt, Santiago Blaumann, Pratyoy Biswas, Yana Rose, Sebastian Bittrich, Jose M. Duarte, Joan Segura, Chunxiao Bi, Douglas Myers-Turnbull, Brian P. Hudson, Christine Zardecki, Stephen K. Burley. rcsb-api: Python Toolkit for Streamlining Access to RCSB Protein Data Bank APIs, Journal of Molecular Biology, 2025. DOI: 10.1016/j.jmb.2025.168970

You should also cite the RCSB.org API services this package utilizes:

Yana Rose, Jose M. Duarte, Robert Lowe, Joan Segura, Chunxiao Bi, Charmi Bhikadiya, Li Chen, Alexander S. Rose, Sebastian Bittrich, Stephen K. Burley, John D. Westbrook. RCSB Protein Data Bank: Architectural Advances Towards Integrated Searching and Efficient Access to Macromolecular Structure Data from the PDB Archive, Journal of Molecular Biology, 2020. DOI: 10.1016/j.jmb.2020.11.003

Documentation and Support

Please refer to the readthedocs page to learn more about package usage and other available features as well as to see more examples.

If you experience any issues installing or using the package, please submit an issue on GitHub and we will try to respond in a timely manner.

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

rcsb_api-1.7.3.tar.gz (601.7 kB view details)

Uploaded Source

Built Distribution

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

rcsb_api-1.7.3-py3-none-any.whl (70.9 kB view details)

Uploaded Python 3

File details

Details for the file rcsb_api-1.7.3.tar.gz.

File metadata

  • Download URL: rcsb_api-1.7.3.tar.gz
  • Upload date:
  • Size: 601.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for rcsb_api-1.7.3.tar.gz
Algorithm Hash digest
SHA256 b9b2c147c098a4c482e34a2c5998b8680d3386c3550dce57fe9d57359eb59d0b
MD5 7750c0ed50b2d9714ad7f436a1fba244
BLAKE2b-256 437c30686058d4fac954f7123e1417a991a1b60a4e36c6c3b268c759f141eb6e

See more details on using hashes here.

File details

Details for the file rcsb_api-1.7.3-py3-none-any.whl.

File metadata

  • Download URL: rcsb_api-1.7.3-py3-none-any.whl
  • Upload date:
  • Size: 70.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for rcsb_api-1.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 674996362c648178bfbe2c4752ae72b37edccb1348a006174716fbcf78620103
MD5 8b9bbbb8e1efe1f645c4d068fd66c309
BLAKE2b-256 758e76484df93fa1dab7ce9ec32231b04bcd4b488a5932b56838059f2c692ee4

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