Skip to main content

fetchprotein

PyPi Version License: MIT

A Python package to fetch a protein 3D Structure / MSA / FASTA file from the PDB, UniProt or AlphaFold-DB (depending on the protein_filename extension).

Supports extensions:

  • pdb: for 3D structure from PDB or AlphaFold-DB
  • cif: for 3D structure from PDB or AlphaFold-DB
  • fasta: for FASTA from PDB or UniProt
  • a3m: for MSA from AlphaFold-DB (API is currently unavailable)

Installation and Usage

Install with pip:

pip install fetchprotein

CLI usage:

fetchprotein --help
fetchprotein 6m0j.pdb
fetchprotein Q9LW00.cif
fetchprotein Q9LW00.a3m # might be currently unavailable
fetchprotein Q9LW00.fasta
fetchprotein 6m0j.fasta

Python usage:
WARNING: Fetch for AlphaFold-DB MSA is currently unavailable.

# Imports
from fetchprotein.fetch import fetchprotein
from fetchprotein.fetch import fetch_structure, fetch_sequence, fetch_msa

# Use generic fetch function
path = fetchprotein('6M0J.pdb', output_dir='./test_data/')     # fetch 3D structure from PDB
path = fetchprotein('Q9LW00.cif', output_dir='./test_data/')   # fetch 3D structure from AlphaFold-DB
path = fetchprotein('Q9LW00.a3m', output_dir='./test_data/')   # fetch MSA from AlphaFold-DB
path = fetchprotein('Q9LW00.fasta', output_dir='./test_data/') # fetch FASTA from UniProt
path = fetchprotein('6M0J.fasta', output_dir='./test_data/')   # fetch FASTA from PDB

# Use specific fetch functions
path = fetch_structure('6M0J', extension="cif", output_dir='./test_data/')
path = fetch_structure('Q9LW00', extension="pdb", output_dir='./test_data/')

path = fetch_sequence('6M0J', extension="fasta", output_dir='./test_data/')
path = fetch_sequence('Q9LW00', extension="fasta", output_dir='./test_data/')

path = fetch_msa('Q9LW00', extension="a3m", output_dir='./test_data/')

Release files for fetchprotein 1.0.1

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

Source distribution (sdist)

Source distribution for fetchprotein 1.0.1
File Size Uploaded
fetchprotein-1.0.1.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fetchprotein 1.0.1
File Interpreter ABI Platform
fetchprotein-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / fetchprotein-1.0.1.tar.gz

Download URL fetchprotein-1.0.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8ad855f7890e770b4d73b77891e0252b332d43f53cb4b962172307e44551fcc0
BLAKE2b-256 checksum
How to use checksums
ad57d8aaf403d3791aa40c18a69d0cdbb413ceb28ef99c81a8ac395e602bb3d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / fetchprotein-1.0.1-py3-none-any.whl

Download URL fetchprotein-1.0.1-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5157aabe5774c4ae4eb7aea6d9fe1b2838b81c7c2480a5d6e592b153ec191e8e
BLAKE2b-256 checksum
How to use checksums
6642e2c2382ab1c0771942c35694d4f93e61185f5b4047a3cc62e2c9b8851d2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

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