Skip to main content

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

Project description

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)
  • 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 (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

# Open PRD definition
view-cif prd --ccd-definition

Options

Option Short Description
--ccd-definition -d Use CCD definition file type
--next-gen -n Use pdb_next_gen format

Configuration

On first run, a default config is created at ~/.config/view-cif/config.yaml.

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.monomers /data/monomers

Config keys

Key Description
editor Editor command to open CIF files (e.g., code, nvim, emacs)
cache_dir Directory for cached CIF output
paths.pdb_next_gen Root directory for next-gen PDB files
paths.bird Root directory for BIRD (PRD) data
paths.monomers Directory containing components.cif.gz
paths.chem_comp Directory for chemical component CIF files
paths.prd Directory for PRD definition CIF files

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

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

view_cif-0.2.2.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

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

view_cif-0.2.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file view_cif-0.2.2.tar.gz.

File metadata

  • Download URL: view_cif-0.2.2.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for view_cif-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ccf5822cb1b96ee436df66440e22987bb161fad1494f466bdb5b489079fc1d87
MD5 9ab579a30ea75699912faf32ce24d853
BLAKE2b-256 67f580b0eee5f7104b378598c3cfcbfa062d4b115112610f8dea29a5f2c7f87e

See more details on using hashes here.

Provenance

The following attestation bundles were made for view_cif-0.2.2.tar.gz:

Publisher: publish.yml on N283T/view-cif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file view_cif-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: view_cif-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for view_cif-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f3f49356bf0b3647725f0d713faf776259acc45ddf01dbc68bf1fc6a8087039
MD5 719741d186d71e178da89af3924d5669
BLAKE2b-256 f31f83752bea9ef27ec7b8a6bc1a30920dbf18ce612ee37baa57bf1238bacaec

See more details on using hashes here.

Provenance

The following attestation bundles were made for view_cif-0.2.2-py3-none-any.whl:

Publisher: publish.yml on N283T/view-cif

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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