Skip to main content

Proteinspy

PyPI Tests Python License: MIT

A CLI tool and Python library for analysing protein structure files.

Supports .cif, .mmcif, .pdb, .ent, and their .gz compressed variants. Full documentation: akhilteja2209.github.io/Proteinspy


Installation

pip install proteinspy

Windows note

If proteinspy is not recognised after installation, add the Python Scripts folder to your PATH. Run this once in PowerShell:

$scriptsPath = python -c "import sysconfig; print(sysconfig.get_path('scripts', 'nt_user'))"
$env:PATH += ";$scriptsPath"
[System.Environment]::SetEnvironmentVariable("PATH", $env:PATH, "User")

Then restart PowerShell and run proteinspy again.


Quick start

# See all commands with
proteinspy
# Or
proteinspy --help

# Run all basic analyses on a structure file
proteinspy analyze my_protein.cif

# Works with PDB format too
proteinspy analyze my_protein.pdb

Commands

Format: proteinspy <command> <file> [--output table|json|csv|tsv]

Basic analyses

Command Description
analyze Run all basic analyses — resolution, chains, ligands, missing residues
resolution Crystallographic resolution and experimental method
chains All polymer chains with type and residue count
ligands Non-solvent ligand molecules
missing Residues present in the sequence but absent from ATOM records

Advanced analyses

Command Description
bfactor B-factor (temperature factor) statistics — global and per chain
disulfide Disulfide bonds detected by SG–SG distance (≤ 2.5 Å)
interface Inter-chain interface residues by Cα distance (default cutoff 5.0 Å)
validate Quick quality check — resolution, completeness, model count
export Export any analysis to a .json, .csv, or .tsv file

Examples

# Basic analyses
proteinspy analyze    my_protein.cif
proteinspy resolution my_protein.cif
proteinspy chains     my_protein.cif
proteinspy ligands    my_protein.cif
proteinspy missing    my_protein.cif

# Advanced analyses
proteinspy bfactor   my_protein.cif
proteinspy disulfide my_protein.cif
proteinspy interface my_protein.cif --cutoff 8.0
proteinspy validate  my_protein.cif

# Output formats — any command supports --output / -o
proteinspy chains    my_protein.cif --output json
proteinspy bfactor   my_protein.cif --output csv
proteinspy analyze   my_protein.cif -o tsv

# Export to file (format inferred from extension)
proteinspy export my_protein.cif report.json
proteinspy export my_protein.cif chains.csv  --analysis chains
proteinspy export my_protein.cif bonds.json  --analysis disulfide

Output formats

Every command accepts --output (or -o):

Format Flag Use case
Rich table --output table Default — coloured terminal output
JSON --output json Downstream scripts, APIs
CSV --output csv Excel, pandas, R
TSV --output tsv Tab-separated, bioinformatics pipelines

Supported file formats

Extension Format
.cif, .mmcif, .pdbx mmCIF (recommended)
.pdb, .ent Legacy PDB format
Any of the above + .gz Gzip-compressed

Python API

You can import and use every analysis function directly:

from proteinspy import get_resolution, get_chains, get_bfactor_stats
from proteinspy import to_json, write_output

# Basic
result = get_resolution("my_protein.cif")
print(result["resolution"], result["method"])

# Advanced
stats = get_bfactor_stats("my_protein.cif")
print(stats["overall"]["mean"])

# Export
write_output(get_chains("my_protein.cif"), "json", output_path="chains.json")

Check out API Reference for the list of all the functions.


Requirements

  • pip installed on device
  • Python 3.10 or later
  • Dependencies installed automatically: gemmi, rich, click

Contributing

Contributions are welcome — new analyses, output formats, bug fixes, or docs. See CONTRIBUTING.md for setup instructions, code standards, and how to add a new analysis command.


Documentation

Full Installation and usage guides at akhilteja2209.github.io/Proteinspy


Version: 1.1.5

Metadata

Release files for proteinspy 1.1.5

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

Source distribution (sdist)

Source distribution for proteinspy 1.1.5
File Size Uploaded Provenance
proteinspy-1.1.5.tar.gz 17.5 kB With provenance Details

Built distribution (wheel)

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

Total release size: 39.6 kB

Release files / proteinspy-1.1.5.tar.gz

Download URL proteinspy-1.1.5.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
42464eb0789bf8a5cad0c1dc361691ee8c1b61e0d584d7c801abc7a4cf6b17b8
BLAKE2b-256 checksum
How to use checksums
df12dba184f7ed42377234a6fdddf20b75ec2406fdb56aed5d266886ac89a190
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 14, 2026.

Transparency log

Release files / proteinspy-1.1.5-py3-none-any.whl

Download URL proteinspy-1.1.5-py3-none-any.whl
Size 22.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60974726c8b329024af400f6cda8ade1d30b4076574263f377266858791c93b6
BLAKE2b-256 checksum
How to use checksums
5bc88a67984a2a197838a5ae97dbd92ed5bda61bbe41fa7e7518271a4da71c04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 14, 2026.

Transparency log

Security for proteinspy 1.1.5

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for proteinspy-1.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 14, 2026.

Transparency log

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.

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