Skip to main content

view-cif

PyPI Python Test License

CLI tool to view CIF files from various sources in your preferred editor.

Features

  • Open CIF files by file path, PDB code, or compound name
  • Automatic download from PDB (including next-gen format)
  • BIRD individual lookup — auto-detects PRD_, PRDCC_, FAM_ prefixes
  • CCD and PRD/PRDCC bulk file support
  • Configurable editor and data paths via YAML config
  • Cache-based viewing (no blocking --wait)

Installation

Requires Python 3.12+.

# From PyPI
pip install view-cif

# Or with uv
uv tool install view-cif

Usage

# Open a local CIF file
view-cif /path/to/structure.cif

# Open by PDB code (uses local mirror or auto-downloads)
view-cif 1abc

# Open next-gen PDB format
view-cif 1abc --next-gen

# Open from a specific directory
view-cif ABC /path/to/cif/dir

# Open CCD chemical component
view-cif ATP

# Individual BIRD lookups (auto-detected by prefix)
view-cif PRD_000010      # PRD definition
view-cif PRDCC_000240    # PRD chemical component
view-cif FAM_000160      # PRD family

# Bulk files
view-cif prd             # prd-all.cif.gz
view-cif prdcc           # prdcc-all.cif.gz
view-cif ccd             # components.cif.gz

Options

Option Short Description
--next-gen -n Use pdb_next_gen format

Configuration

On first run, a default config is created at ~/.config/view-cif/config.yaml. See config.example.yaml for a fully commented template.

Managing config via CLI

# Show current configuration
view-cif config show

# Change editor
view-cif config set editor nvim

# Set data paths
view-cif config set paths.chem_comp /data/chem_comp
view-cif config set paths.prd /data/bird

Config keys

Key Description Example
editor Editor command (any terminal command) code, nvim, vim
cache_dir Directory for cached CIF output ~/.cache/view-cif
paths.pdb_next_gen Next-gen PDB archive root /data/pdb_nextgen
paths.bird BIRD bulk files (prd-all.cif.gz, prdcc-all.cif.gz) /data/bird/prd
paths.monomers CCD monomers (components.cif.gz) /data/monomers
paths.chem_comp Chemical component reference data /data/chem_comp
paths.prd BIRD reference root (prd/, prdcc/, family/ subdirs) /data/refdata/bird

Directory structure expectations

Path resolution follows the PDB FTP/rsync mirror directory layout. If you maintain a local mirror, point each config path to the corresponding directory.

~ and environment variables ($HOME, $PDB_ROOT, etc.) are expanded automatically.

paths.pdb_next_gen/
  entries/divided/{ab}/pdb_{id}/pdb_{id}_xyz-enrich.cif.gz

paths.bird/
  prd-all.cif.gz
  prdcc-all.cif.gz

paths.monomers/
  components.cif.gz

paths.chem_comp/
  {X}/{ABC}/ABC.cif          # nested by first character

paths.prd/
  prd/    {N}/PRD_NNNNNN.cif
  prdcc/  {N}/PRDCC_NNNNNN.cif
  family/ {N}/FAM_NNNNNN.cif

Development

# Install with dev dependencies
uv sync --group dev

# Run tests
uv run pytest --cov=view_cif -v

# Lint
uv run ruff check .

License

MIT

Metadata

Release files for view-cif 0.2.3

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

Source distribution (sdist)

Source distribution for view-cif 0.2.3
File Size Uploaded Provenance
view_cif-0.2.3.tar.gz 31.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for view-cif 0.2.3
File Interpreter ABI Platform
view_cif-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 40.7 kB

Release files / view_cif-0.2.3.tar.gz

Download URL view_cif-0.2.3.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d13b439793503b6b3ce228804168277347a4731b3088ea323783a454cbae152f
BLAKE2b-256 checksum
How to use checksums
e53f1a78c41e5d93c33e3f91523d9e90c55c4703534dd9e02ce743cb1a8b7f51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 7, 2026.

Transparency log

Release files / view_cif-0.2.3-py3-none-any.whl

Download URL view_cif-0.2.3-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29b88a2e699a814f4230a8400106425dc885bde2e28f0b50452c33be63f4a6a6
BLAKE2b-256 checksum
How to use checksums
ac24f77fdf711ecc4aa907f65d36acc586eb960b4a4925b9c7dd67a0d857498c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 7, 2026.

Transparency log

Security for view-cif 0.2.3

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 view_cif-0.2.3.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 Mar 7, 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