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.1.tar.gz (29.1 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.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: view_cif-0.2.1.tar.gz
  • Upload date:
  • Size: 29.1 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.1.tar.gz
Algorithm Hash digest
SHA256 d0327da89d35e97c9be6f97a92247f95739b9ade2758d434dd759478a43ef4e6
MD5 60fb759007901a967928d64c8b4b3adb
BLAKE2b-256 f6bdb09fb247f9f4de35d4429773e362f7d498984157e32ef2f75031e415f393

See more details on using hashes here.

Provenance

The following attestation bundles were made for view_cif-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: view_cif-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b5ac4e8123850d1517cec8873ecc7fdf0512e3f41f3db1cf02c106a15187c1c
MD5 6e77c3318485ac8bc80ada30258e1906
BLAKE2b-256 f313a96905cd7b70039e6369a5288e9f86f78c8262ff1c071520995ebaf7c6c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for view_cif-0.2.1-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